Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dependency injection (part 2 - register services with hosting framework) #179

Closed
baseTwo opened this issue Feb 14, 2024 · 1 comment
Closed
Labels
CqlToElm ElmToLinq LinqToC# Operators Packaging refactor Structural code changes without changing functionality

Comments

@baseTwo
Copy link
Collaborator

baseTwo commented Feb 14, 2024

Background

Currently services leak out their dependencies via properties e.g ExpressionBuildsr leaks out TypeManager and TypeManager leaks out TypeResolver.

Use dependencies via DI and keep them private.

Solution

The solution is over two parts:

  1. Introduce the host builder in the Program Main. Use IOptions<> to extract commandline arguments. (Issue Use dependency injection (part 1 - introduce the host builder and load arguments with IOptions) #172)
  2. Register classes like ExpressionBuilder, TypeManager, etc as services and use the hosting framework to for managing their lifetime and injecting dependencies. (This issue)
@baseTwo
Copy link
Collaborator Author

baseTwo commented Feb 28, 2024

Completed as part of PR #183

@baseTwo baseTwo closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CqlToElm ElmToLinq LinqToC# Operators Packaging refactor Structural code changes without changing functionality
Projects
None yet
Development

No branches or pull requests

1 participant