DbContextActivator.CreateInstance Yöntem

Tanım

Aşırı Yüklemeler

CreateInstance(Type, Assembly, IOperationReportHandler)

DbContextStandart tasarım zamanı mekanizmalarını kullanarak belirtilen türde bir örnek oluşturur. Kullanılabilir olduğunda, bu işlem tüm IDesignTimeDbContextFactory<TContext> uygulamaları veya uygulamanın hizmet sağlayıcısını kullanır.

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

DbContextStandart tasarım zamanı mekanizmalarını kullanarak belirtilen türde bir örnek oluşturur. Kullanılabilir olduğunda, bu işlem tüm IDesignTimeDbContextFactory<TContext> uygulamaları veya uygulamanın hizmet sağlayıcısını kullanır.

CreateInstance(Type, Assembly, IOperationReportHandler)

DbContextStandart tasarım zamanı mekanizmalarını kullanarak belirtilen türde bir örnek oluşturur. Kullanılabilir olduğunda, bu işlem tüm IDesignTimeDbContextFactory<TContext> uygulamaları veya uygulamanın hizmet sağlayıcısını kullanır.

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

Parametreler

contextType
Type

DbContextÖrneklendirilecek tür.

startupAssembly
Assembly

Uygulamanın başlangıç derlemesi.

reportHandler
IOperationReportHandler

Tasarım zamanı rapor işleyicisi.

Döndürülenler

DbContext

Yeni oluşturulan nesne.

Şunlara uygulanır

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

DbContextStandart tasarım zamanı mekanizmalarını kullanarak belirtilen türde bir örnek oluşturur. Kullanılabilir olduğunda, bu işlem tüm IDesignTimeDbContextFactory<TContext> uygulamaları veya uygulamanın hizmet sağlayıcısını kullanır.

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

Parametreler

contextType
Type

DbContextÖrneklendirilecek tür.

startupAssembly
Assembly

Uygulamanın başlangıç derlemesi.

reportHandler
IOperationReportHandler

Tasarım zamanı rapor işleyicisi.

args
String[]

Uygulamaya geçirilen bağımsız değişkenler.

Döndürülenler

DbContext

Yeni oluşturulan nesne.

Şunlara uygulanır