Sdílet prostřednictvím


DbContextActivator.CreateInstance Metoda

Definice

Přetížení

CreateInstance(Type, Assembly, IOperationReportHandler)

Vytvoří instanci zadaného DbContext typu pomocí standardních mechanismů návrhu. Pokud je k dispozici, použije se všechny IDesignTimeDbContextFactory<TContext> implementace nebo poskytovatel služeb aplikace.

CreateInstance(Type, Assembly, IOperationReportHandler, String[])

Vytvoří instanci zadaného DbContext typu pomocí standardních mechanismů návrhu. Pokud je k dispozici, použije se všechny IDesignTimeDbContextFactory<TContext> implementace nebo poskytovatel služeb aplikace.

CreateInstance(Type, Assembly, IOperationReportHandler)

Vytvoří instanci zadaného DbContext typu pomocí standardních mechanismů návrhu. Pokud je k dispozici, použije se všechny IDesignTimeDbContextFactory<TContext> implementace nebo poskytovatel služeb aplikace.

public static Microsoft.EntityFrameworkCore.DbContext CreateInstance (Type contextType, System.Reflection.Assembly startupAssembly = default, Microsoft.EntityFrameworkCore.Design.IOperationReportHandler reportHandler = default);
public static Microsoft.EntityFrameworkCore.DbContext CreateInstance (Type contextType, System.Reflection.Assembly? startupAssembly = default, Microsoft.EntityFrameworkCore.Design.IOperationReportHandler? reportHandler = default);
static member CreateInstance : Type * System.Reflection.Assembly * Microsoft.EntityFrameworkCore.Design.IOperationReportHandler -> Microsoft.EntityFrameworkCore.DbContext
Public Shared Function CreateInstance (contextType As Type, Optional startupAssembly As Assembly = Nothing, Optional reportHandler As IOperationReportHandler = Nothing) As DbContext

Parametry

contextType
Type

Typ DbContext , který se má vytvořit instance.

startupAssembly
Assembly

Sestavení aplikace při spuštění.

reportHandler
IOperationReportHandler

Obslužná rutina sestavy při návrhu.

Návraty

Nově vytvořený objekt

Platí pro

CreateInstance(Type, Assembly, IOperationReportHandler, String[])

Vytvoří instanci zadaného DbContext typu pomocí standardních mechanismů návrhu. Pokud je k dispozici, použije se všechny IDesignTimeDbContextFactory<TContext> implementace nebo poskytovatel služeb aplikace.

public static Microsoft.EntityFrameworkCore.DbContext CreateInstance (Type contextType, System.Reflection.Assembly startupAssembly, Microsoft.EntityFrameworkCore.Design.IOperationReportHandler reportHandler, string[] args);
public static Microsoft.EntityFrameworkCore.DbContext CreateInstance (Type contextType, System.Reflection.Assembly? startupAssembly, Microsoft.EntityFrameworkCore.Design.IOperationReportHandler? reportHandler, string[]? args);
static member CreateInstance : Type * System.Reflection.Assembly * Microsoft.EntityFrameworkCore.Design.IOperationReportHandler * string[] -> Microsoft.EntityFrameworkCore.DbContext
Public Shared Function CreateInstance (contextType As Type, startupAssembly As Assembly, reportHandler As IOperationReportHandler, args As String()) As DbContext

Parametry

contextType
Type

Typ DbContext , který se má vytvořit instance.

startupAssembly
Assembly

Sestavení aplikace při spuštění.

reportHandler
IOperationReportHandler

Obslužná rutina sestavy při návrhu.

args
String[]

Argumenty předané aplikaci.

Návraty

Nově vytvořený objekt

Platí pro