语言

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
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
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[]

传递给应用程序的参数。

返回

新建的对象。

适用于