Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
UseRootApplicationServiceProvider(IServiceProvider) |
Sets the root IServiceProvider from which singleton application services can be obtained from singleton internal services. |
UseRootApplicationServiceProvider() |
Resolves the root IServiceProvider from the scoped application service provider. The root provider can be used to obtain singleton application services from singleton internal services. |
Sets the root IServiceProvider from which singleton application services can be obtained from singleton internal services.
public virtual Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseRootApplicationServiceProvider(IServiceProvider? rootServiceProvider);
abstract member UseRootApplicationServiceProvider : IServiceProvider -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
override this.UseRootApplicationServiceProvider : IServiceProvider -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
Public Overridable Function UseRootApplicationServiceProvider (rootServiceProvider As IServiceProvider) As DbContextOptionsBuilder
The service provider to be used.
The same builder instance so that multiple calls can be chained.
This is an advanced option that is rarely needed by normal applications. Calling this method will result in a new internal service provider being created for every different root application service provider.
See Using DbContextOptions for more information and examples.
Product | Versions |
---|---|
Resolves the root IServiceProvider from the scoped application service provider. The root provider can be used to obtain singleton application services from singleton internal services.
public virtual Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseRootApplicationServiceProvider();
abstract member UseRootApplicationServiceProvider : unit -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
override this.UseRootApplicationServiceProvider : unit -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
Public Overridable Function UseRootApplicationServiceProvider () As DbContextOptionsBuilder
The same builder instance so that multiple calls can be chained.
This is an advanced option that is rarely needed by normal applications. Calling this method will result in a new internal service provider being created for every different root application service provider.
See Using DbContextOptions for more information and examples.
Product | Versions |
---|---|
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in