DbContextOptionsBuilder<TContext>.UseApplicationServiceProvider Method
Definition
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.
Sets the IServiceProvider from which application services will be obtained. This is done automatically when using 'AddDbContext', so it is rare that this method needs to be called.
public virtual Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseApplicationServiceProvider (IServiceProvider serviceProvider);
public virtual Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseApplicationServiceProvider (IServiceProvider? serviceProvider);
override this.UseApplicationServiceProvider : IServiceProvider -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)>
Public Overridable Function UseApplicationServiceProvider (serviceProvider As IServiceProvider) As DbContextOptionsBuilder(Of TContext)
Parameters
- serviceProvider
- IServiceProvider
The service provider to be used.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Using DbContextOptions for more information and examples.
Applies to
Met ons samenwerken op GitHub
De bron voor deze inhoud vindt u op GitHub, waar u ook problemen en pull-aanvragen kunt maken en controleren. Bekijk onze gids voor inzenders voor meer informatie.
Entity Framework