EntityFrameworkServiceCollectionExtensions EntityFrameworkServiceCollectionExtensions Class

Definition

Extension methods for setting up Entity Framework related services in an .

public static class EntityFrameworkServiceCollectionExtensions
Public Module EntityFrameworkServiceCollectionExtensions
Inheritance
System.ObjectSystem.Object
EntityFrameworkServiceCollectionExtensionsEntityFrameworkServiceCollectionExtensions

Methods

AddDbContext<TContext>(IServiceCollection, Action<DbContextOptionsBuilder>, ServiceLifetime) AddDbContext(Of TContext)(IServiceCollection, Action(Of DbContextOptionsBuilder), ServiceLifetime)

Registers the given context as a service in the . You use this method when using dependency injection in your application, such as with ASP.NET. For more information on setting up dependency injection, see http://go.microsoft.com/fwlink/?LinkId=526890.

AddDbContext<TContext>(IServiceCollection, Action<IServiceProvider, DbContextOptionsBuilder>, ServiceLifetime) AddDbContext(Of TContext)(IServiceCollection, Action(Of IServiceProvider, DbContextOptionsBuilder), ServiceLifetime)

Registers the given context as a service in the . You use this method when using dependency injection in your application, such as with ASP.NET. For more information on setting up dependency injection, see http://go.microsoft.com/fwlink/?LinkId=526890.

This overload has an optionsAction that provides the applications System.IServiceProvider. This is useful if you want to setup Entity Framework to resolve its internal services from the primary application service provider. By default, we recommend using the other overload, which allows Entity Framework to create and maintain its own System.IServiceProvider for internal Entity Framework services.

AddDbContext<TContext>(IServiceCollection, ServiceLifetime) AddDbContext(Of TContext)(IServiceCollection, ServiceLifetime)

Registers the given context as a service in the . You use this method when using dependency injection in your application, such as with ASP.NET. For more information on setting up dependency injection, see http://go.microsoft.com/fwlink/?LinkId=526890.

System.Object.Equals(System.Object) System.Object.Equals(System.Object) Inherited from System.Object
System.Object.Equals(System.Object, System.Object) System.Object.Equals(System.Object, System.Object) Inherited from System.Object
System.Object.GetHashCode() System.Object.GetHashCode() Inherited from System.Object
System.Object.GetType() System.Object.GetType() Inherited from System.Object
System.Object.MemberwiseClone() System.Object.MemberwiseClone() Inherited from System.Object
System.Object.ReferenceEquals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) Inherited from System.Object
System.Object.ToString() System.Object.ToString() Inherited from System.Object