Export (0) Print
Expand All

IDbContextFactory<TContext> Interface

Entity Framework 5.0

A factory for creating derived DbContext instances. Implement this interface to enable design-time services and instantiation for context types that do not have a public default constructor. You can create derived DbContext instances at design time to enable specific design-time experiences such as model rendering and DDL generation. Design-time services can 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

out TContext

This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see http://msdn.microsoft.com/en-us/library/dd799517(v=vs.103).aspx.

The IDbContextFactory<TContext> type exposes the following members.

  NameDescription
Public methodCreateCreates a new instance of a derived DbContext type.
Top
Show:
© 2014 Microsoft