IDbContextFactory<TContext> IDbContextFactory(Of 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 Migrations. Design-time services will automatically discover implementations of this interface that are in the same assembly as the derived context.

Syntax

Declaration

public interface IDbContextFactory<out TContext>
    where TContext : DbContextPublic Interface IDbContextFactory(Of Out TContext As DbContext)

Type Parameters

TContext The type of the context.

Methods summary

Creates a new instance of a derived context.

Methods

  • Create(DbContextFactoryOptions)
    Create(DbContextFactoryOptions)

    Creates a new instance of a derived context.

    TContext Create(DbContextFactoryOptions options)Function Create(options As DbContextFactoryOptions) As TContext

    Parameters

    Returns

    • TContext
      TContext

      An instance of TContext.

Details

Assembly

Microsoft.EntityFrameworkCore.dll