Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ProxiesExtensions.CreateProxy Method

Definition

Namespace:
Microsoft.EntityFrameworkCore
Assembly:
Microsoft.EntityFrameworkCore.Proxies.dll
Package:
Microsoft.EntityFrameworkCore.Proxies v10.0.0
Package:
Microsoft.EntityFrameworkCore.Proxies v2.1.11
Package:
Microsoft.EntityFrameworkCore.Proxies v2.2.6
Package:
Microsoft.EntityFrameworkCore.Proxies v3.0.0
Package:
Microsoft.EntityFrameworkCore.Proxies v3.1.0
Package:
Microsoft.EntityFrameworkCore.Proxies v5.0.0
Package:
Microsoft.EntityFrameworkCore.Proxies v6.0.0
Package:
Microsoft.EntityFrameworkCore.Proxies v7.0.0
Package:
Microsoft.EntityFrameworkCore.Proxies v8.0.0
Package:
Microsoft.EntityFrameworkCore.Proxies v9.0.0

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
CreateProxy(DbContext, Type, Object[])

Creates a proxy instance for an entity type if proxy creation has been turned on.

CreateProxy<TEntity>(DbContext, Object[])

Creates a proxy instance for an entity type if proxy creation has been turned on.

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

Creates a proxy instance for an entity type if proxy creation has been turned on.

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

Creates a proxy instance for an entity type if proxy creation has been turned on.

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

Creates a proxy instance for an entity type if proxy creation has been turned on.

CreateProxy(DbContext, Type, Object[])

Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs

Creates a proxy instance for an entity type if proxy creation has been turned on.

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

Parameters

context
DbContext

The DbContext.

entityType
Type

The entity type for which a proxy is needed.

constructorArguments
Object[]

Arguments to pass to the entity type constructor.

Returns

The proxy instance.

Applies to

CreateProxy<TEntity>(DbContext, Object[])

Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs

Creates a proxy instance for an entity type if proxy creation has been turned on.

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

Type Parameters

TEntity

The entity type for which a proxy is needed.

Parameters

context
DbContext

The DbContext.

constructorArguments
Object[]

Arguments to pass to the entity type constructor.

Returns

TEntity

The proxy instance.

Applies to

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

Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs

Creates a proxy instance for an entity type if proxy creation has been turned on.

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

Type Parameters

TEntity

The entity type for which a proxy is needed.

Parameters

constructorArguments
Object[]

Arguments to pass to the entity type constructor.

Returns

TEntity

The proxy instance.

Applies to

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

Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs

Creates a proxy instance for an entity type if proxy creation has been turned on.

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

Type Parameters

TEntity

The entity type for which a proxy is needed.

Parameters

context
DbContext

The DbContext.

configureEntity
Action<TEntity>

Called after the entity is created to set property values, etc.

constructorArguments
Object[]

Arguments to pass to the entity type constructor.

Returns

TEntity

The proxy instance.

Applies to

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

Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs

Creates a proxy instance for an entity type if proxy creation has been turned on.

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

Type Parameters

TEntity

The entity type for which a proxy is needed.

Parameters

configureEntity
Action<TEntity>

Called after the entity is created to set property values, etc.

constructorArguments
Object[]

Arguments to pass to the entity type constructor.

Returns

TEntity

The proxy instance.

Applies to


Feedback

Was this page helpful?