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

Add documentation for the state of the library with depency injection. #29

Open
antonioortizpola opened this issue Apr 4, 2024 · 1 comment

Comments

@antonioortizpola
Copy link

After playing a little with the new library, I noticed that some classes seem to be ready to be used with dependency injection, while others not.

I can see there is a ServiceCollectionExtensions for authentication for example, that also calls services.AddForgeService(configuration) to add the SDK base.

But then, it does not add AuthenticationClient, same with AddForgeService, which does not add the SdkManager, but adds the ForgeService, which is not used then on the ApsClient initialization,
image
This makes the use of dependency injection more difficult, since we need to override the forge service after initialization.

This also makes me question about how the initialization is shown on the examples, because it is creating a new service collection to get the HttpClient, Instead of letting the web application to handle the HttpClient creation.

image

Would not be better to use dependency injection as default and this just as a workaround? Is there a plan to add a Tutorial or demo integrated with .Net hosted service or web app?

About that, is there a plan to fully integrate the library with DI? I know I can get it to work with DI, for example (more work needs to be done, just an example)
image

But, if there is a plan on your side to integrate and document this integration, I would prefer to wait to use the same code and standard.

@sajith-subramanian
Copy link
Contributor

Thanks for the suggestion. While we do not have a plan to address this as of now,,I can log this for further investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants