Share via


IDbContextFactory<TContext> Interface

Definition

Defines a factory for creating DbContext instances.

public interface IDbContextFactory<TContext> where TContext : DbContext
public interface IDbContextFactory<out TContext> where TContext : DbContext
type IDbContextFactory<'Context (requires 'Context :> DbContext)> = interface
Public Interface IDbContextFactory(Of TContext)
Public Interface IDbContextFactory(Of Out TContext)

Type Parameters

TContext

The DbContext type to create.

Derived

Remarks

See Using DbContextFactory for more information and examples.

Methods

Name Description
CreateDbContext()

Creates a new DbContext instance.

CreateDbContextAsync(CancellationToken)

Creates a new DbContext instance in an async context.

Applies to