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

Support resolving application services from singleton internal services #29950

Merged
merged 2 commits into from
Dec 31, 2022

Conversation

ajcvickers
Copy link
Member

Fixes #13540

Scoped and transient internal services can obtain application services using the DbContext as a service locator. Singleton services cannot do this since they do not have access to the DbContext. This change allows the root application service provider to be registered as an ISingletonOption such that singleton internal services can resolve singleton and transient application services.

@ajcvickers ajcvickers requested a review from a team December 30, 2022 19:30
Fixes #13540

Scoped and transient internal services can obtain application services using the `DbContext` as a service locator. Singleton services cannot do this since they do not have access to the `DbContext`. This change allows the root application service provider to be registered as an `ISingletonOption` such that singleton internal services can resolve singleton and transient application services.
@ajcvickers
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ajcvickers ajcvickers merged commit ad8db34 into main Dec 31, 2022
@ajcvickers ajcvickers deleted the KnowYourRoots1230 branch December 31, 2022 16:10
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

Successfully merging this pull request may close these issues.

Allow services to be easily resolved from the application service provider from within EF Core
2 participants