語言

DbContextActivator.CreateInstance 方法

定義

多載

名稱 Description
CreateInstance(Type, Assembly, IOperationReportHandler)

使用標準設計階段機制,建立指定 DbContext 型別的實例。 可用時,這會使用任何 IDesignTimeDbContextFactory<TContext> 實作或應用程式的服務提供者。

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

使用標準設計階段機制,建立指定 DbContext 型別的實例。 可用時,這會使用任何 IDesignTimeDbContextFactory<TContext> 實作或應用程式的服務提供者。

CreateInstance(Type, Assembly, IOperationReportHandler)

來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
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[])

來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
DbContextActivator.cs
來源:
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[]

傳遞至應用程式的引數。

傳回

新建立的物件。

適用於