ProxiesExtensions.UseLazyLoadingProxies ProxiesExtensions.UseLazyLoadingProxies ProxiesExtensions.UseLazyLoadingProxies Method

Definition

Overloads

UseLazyLoadingProxies(DbContextOptionsBuilder, Boolean) UseLazyLoadingProxies(DbContextOptionsBuilder, Boolean) UseLazyLoadingProxies(DbContextOptionsBuilder, Boolean)

Turns on the creation of lazy-loading proxies.

Note that this requires appropriate services to be available in the EF internal service provider. Normally this will happen automatically, but if the application is controlling the service provider, then a call to AddEntityFrameworkProxies(IServiceCollection) may be needed.

UseLazyLoadingProxies<TContext>(DbContextOptionsBuilder<TContext>, Boolean) UseLazyLoadingProxies<TContext>(DbContextOptionsBuilder<TContext>, Boolean) UseLazyLoadingProxies<TContext>(DbContextOptionsBuilder<TContext>, Boolean)

Turns on the creation of lazy-loading proxies.

Note that this requires appropriate services to be available in the EF internal service provider. Normally this will happen automatically, but if the application is controlling the service provider, then a call to AddEntityFrameworkProxies(IServiceCollection) may be needed.

UseLazyLoadingProxies(DbContextOptionsBuilder, Boolean) UseLazyLoadingProxies(DbContextOptionsBuilder, Boolean) UseLazyLoadingProxies(DbContextOptionsBuilder, Boolean)

Turns on the creation of lazy-loading proxies.

Note that this requires appropriate services to be available in the EF internal service provider. Normally this will happen automatically, but if the application is controlling the service provider, then a call to AddEntityFrameworkProxies(IServiceCollection) may be needed.

public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseLazyLoadingProxies (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, bool useLazyLoadingProxies = true);
static member UseLazyLoadingProxies : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder * bool -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
<Extension()>
Public Function UseLazyLoadingProxies (optionsBuilder As DbContextOptionsBuilder, Optional useLazyLoadingProxies As Boolean = true) As DbContextOptionsBuilder

Parameters

optionsBuilder
DbContextOptionsBuilder DbContextOptionsBuilder DbContextOptionsBuilder

The options builder, as passed to OnConfiguring(DbContextOptionsBuilder) or exposed AddDbContext.

useLazyLoadingProxies
Boolean Boolean Boolean

True to use lazy-loading proxies; false to prevent their use.

Returns

The same builder to allow method calls to be chained.

UseLazyLoadingProxies<TContext>(DbContextOptionsBuilder<TContext>, Boolean) UseLazyLoadingProxies<TContext>(DbContextOptionsBuilder<TContext>, Boolean) UseLazyLoadingProxies<TContext>(DbContextOptionsBuilder<TContext>, Boolean)

Turns on the creation of lazy-loading proxies.

Note that this requires appropriate services to be available in the EF internal service provider. Normally this will happen automatically, but if the application is controlling the service provider, then a call to AddEntityFrameworkProxies(IServiceCollection) may be needed.

public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseLazyLoadingProxies<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, bool useLazyLoadingProxies = true) where TContext : Microsoft.EntityFrameworkCore.DbContext;
static member UseLazyLoadingProxies : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> * bool -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)
<Extension()>
Public Function UseLazyLoadingProxies(Of TContext As DbContext) (optionsBuilder As DbContextOptionsBuilder(Of TContext), Optional useLazyLoadingProxies As Boolean = true) As DbContextOptionsBuilder(Of TContext)

Type Parameters

TContext

The DbContext type.

Parameters

useLazyLoadingProxies
Boolean Boolean Boolean

True to use lazy-loading proxies; false to prevent their use.

Returns

Applies to