ProxiesExtensions.CreateProxy 方法

定義

多載

CreateProxy(DbContext, Type, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

CreateProxy<TEntity>(DbContext, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

CreateProxy<TEntity>(DbSet<TEntity>, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

CreateProxy<TEntity>(DbContext, Action<TEntity>, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

CreateProxy<TEntity>(DbSet<TEntity>, Action<TEntity>, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

CreateProxy(DbContext, Type, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

public static object CreateProxy (this Microsoft.EntityFrameworkCore.DbContext context, Type entityType, params object[] constructorArguments);
static member CreateProxy : Microsoft.EntityFrameworkCore.DbContext * Type * obj[] -> obj
<Extension()>
Public Function CreateProxy (context As DbContext, entityType As Type, ParamArray constructorArguments As Object()) As Object

參數

context
DbContext

DbContext

entityType
Type

需要 Proxy 的實體類型。

constructorArguments
Object[]

要傳遞至實體類型建構函式的引數。

傳回

Proxy 實例。

適用於

CreateProxy<TEntity>(DbContext, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

public static TEntity CreateProxy<TEntity> (this Microsoft.EntityFrameworkCore.DbContext context, params object[] constructorArguments);
static member CreateProxy : Microsoft.EntityFrameworkCore.DbContext * obj[] -> 'Entity
<Extension()>
Public Function CreateProxy(Of TEntity) (context As DbContext, ParamArray constructorArguments As Object()) As TEntity

類型參數

TEntity

需要 Proxy 的實體類型。

參數

context
DbContext

DbContext

constructorArguments
Object[]

要傳遞至實體類型建構函式的引數。

傳回

TEntity

Proxy 實例。

適用於

CreateProxy<TEntity>(DbSet<TEntity>, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

public static TEntity CreateProxy<TEntity> (this Microsoft.EntityFrameworkCore.DbSet<TEntity> set, params object[] constructorArguments) where TEntity : class;
static member CreateProxy : Microsoft.EntityFrameworkCore.DbSet<'Entity (requires 'Entity : null)> * obj[] -> 'Entity (requires 'Entity : null)
<Extension()>
Public Function CreateProxy(Of TEntity As Class) (set As DbSet(Of TEntity), ParamArray constructorArguments As Object()) As TEntity

類型參數

TEntity

需要 Proxy 的實體類型。

參數

constructorArguments
Object[]

要傳遞至實體類型建構函式的引數。

傳回

TEntity

Proxy 實例。

適用於

CreateProxy<TEntity>(DbContext, Action<TEntity>, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

public static TEntity CreateProxy<TEntity> (this Microsoft.EntityFrameworkCore.DbContext context, Action<TEntity> configureEntity, params object[] constructorArguments);
public static TEntity CreateProxy<TEntity> (this Microsoft.EntityFrameworkCore.DbContext context, Action<TEntity>? configureEntity, params object[] constructorArguments);
static member CreateProxy : Microsoft.EntityFrameworkCore.DbContext * Action<'Entity> * obj[] -> 'Entity
<Extension()>
Public Function CreateProxy(Of TEntity) (context As DbContext, configureEntity As Action(Of TEntity), ParamArray constructorArguments As Object()) As TEntity

類型參數

TEntity

需要 Proxy 的實體類型。

參數

context
DbContext

DbContext

configureEntity
Action<TEntity>

在建立實體以設定屬性值等之後呼叫。

constructorArguments
Object[]

要傳遞至實體類型建構函式的引數。

傳回

TEntity

Proxy 實例。

適用於

CreateProxy<TEntity>(DbSet<TEntity>, Action<TEntity>, Object[])

如果已開啟 Proxy 建立,請為實體類型建立 Proxy 實例。

public static TEntity CreateProxy<TEntity> (this Microsoft.EntityFrameworkCore.DbSet<TEntity> set, Action<TEntity> configureEntity, params object[] constructorArguments) where TEntity : class;
public static TEntity CreateProxy<TEntity> (this Microsoft.EntityFrameworkCore.DbSet<TEntity> set, Action<TEntity>? configureEntity, params object[] constructorArguments) where TEntity : class;
static member CreateProxy : Microsoft.EntityFrameworkCore.DbSet<'Entity (requires 'Entity : null)> * Action<'Entity (requires 'Entity : null)> * obj[] -> 'Entity (requires 'Entity : null)
<Extension()>
Public Function CreateProxy(Of TEntity As Class) (set As DbSet(Of TEntity), configureEntity As Action(Of TEntity), ParamArray constructorArguments As Object()) As TEntity

類型參數

TEntity

需要 Proxy 的實體類型。

參數

configureEntity
Action<TEntity>

在建立實體以設定屬性值等之後呼叫。

constructorArguments
Object[]

要傳遞至實體類型建構函式的引數。

傳回

TEntity

Proxy 實例。

適用於