IDbContextFactory<TContext> Interface

 

A factory for creating derived DbContext instances. Implement this interface to enable design-time services for context types that do not have a public default constructor. At design-time, derived DbContext instances can be created in order to enable specific design-time experiences such as model rendering, DDL generation etc. To enable design-time instantiation for derived DbContext types that do not have a public, default constructor, implement this interface. Design-time services will auto-discover implementations of this interface that are in the same assembly as the derived DbContext type.

Namespace:   System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

public interface IDbContextFactory<out TContext>
where TContext : DbContext

Type Parameters

outTContext

The type of the context.

NameDescription
System_CAPS_pubmethodCreate()

Creates a new instance of a derived DbContext type.