DbContextActivator.CreateInstance 方法

定义

重载

CreateInstance(Type, Assembly, IOperationReportHandler)

使用标准设计时机制创建指定 DbContext 类型的实例。 如果可用,这将使用任何 IDesignTimeDbContextFactory<TContext> 实现或应用程序的服务提供程序。

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

使用标准设计时机制创建指定 DbContext 类型的实例。 如果可用,这将使用任何 IDesignTimeDbContextFactory<TContext> 实现或应用程序的服务提供程序。

CreateInstance(Type, Assembly, IOperationReportHandler)

Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs

使用标准设计时机制创建指定 DbContext 类型的实例。 如果可用,这将使用任何 IDesignTimeDbContextFactory<TContext> 实现或应用程序的服务提供程序。

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

参数

contextType
Type

DbContext 实例化的类型。

startupAssembly
Assembly

应用程序的启动程序集。

reportHandler
IOperationReportHandler

设计时报表处理程序。

返回

新创建的对象。

适用于

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

Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs
Source:
DbContextActivator.cs

使用标准设计时机制创建指定 DbContext 类型的实例。 如果可用,这将使用任何 IDesignTimeDbContextFactory<TContext> 实现或应用程序的服务提供程序。

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

参数

contextType
Type

DbContext 实例化的类型。

startupAssembly
Assembly

应用程序的启动程序集。

reportHandler
IOperationReportHandler

设计时报表处理程序。

args
String[]

传递给应用程序的参数。

返回

新创建的对象。

适用于