ProxiesExtensions.UseLazyLoadingProxies Method

Definition

Overloads

UseLazyLoadingProxies(DbContextOptionsBuilder, Action<LazyLoadingProxiesOptionsBuilder>)

Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs

Turns on the creation of lazy loading proxies.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseLazyLoadingProxies (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, Action<Microsoft.EntityFrameworkCore.LazyLoadingProxiesOptionsBuilder> lazyLoadingProxiesOptionsAction);

Parameters

optionsBuilder
DbContextOptionsBuilder

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

lazyLoadingProxiesOptionsAction
Action<LazyLoadingProxiesOptionsBuilder>

An optional action to allow additional proxy-specific configuration.

Returns

The same builder to allow method calls to be chained.

Remarks

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.

See Lazy loading for more information and examples.

Applies to

Entity Framework Core 9.0 i Entity Framework Core 8.0
Proizvod Verzije
Entity Framework Core 8.0, 9.0

UseLazyLoadingProxies(DbContextOptionsBuilder, Boolean)

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

Turns on the creation of lazy loading proxies.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseLazyLoadingProxies (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, bool useLazyLoadingProxies = true);

Parameters

optionsBuilder
DbContextOptionsBuilder

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

useLazyLoadingProxies
Boolean

true to use lazy loading proxies; false to prevent their use.

Returns

The same builder to allow method calls to be chained.

Remarks

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.

See Lazy loading for more information and examples.

Applies to

Entity Framework Core 9.0 i druge verzije
Proizvod Verzije
Entity Framework Core 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

UseLazyLoadingProxies<TContext>(DbContextOptionsBuilder<TContext>, Action<LazyLoadingProxiesOptionsBuilder>)

Source:
ProxiesExtensions.cs
Source:
ProxiesExtensions.cs

Turns on the creation of lazy loading proxies.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseLazyLoadingProxies<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, Action<Microsoft.EntityFrameworkCore.LazyLoadingProxiesOptionsBuilder> lazyLoadingProxiesOptionsAction) where TContext : Microsoft.EntityFrameworkCore.DbContext;

Type Parameters

TContext

The DbContext type.

Parameters

optionsBuilder
DbContextOptionsBuilder<TContext>

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

lazyLoadingProxiesOptionsAction
Action<LazyLoadingProxiesOptionsBuilder>

An optional action to allow additional proxy-specific configuration.

Returns

The same builder to allow method calls to be chained.

Remarks

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.

See Lazy loading for more information and examples.

Applies to

Entity Framework Core 9.0 i Entity Framework Core 8.0
Proizvod Verzije
Entity Framework Core 8.0, 9.0

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

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

Turns on the creation of lazy loading proxies.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseLazyLoadingProxies<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, bool useLazyLoadingProxies = true) where TContext : Microsoft.EntityFrameworkCore.DbContext;

Type Parameters

TContext

The DbContext type.

Parameters

optionsBuilder
DbContextOptionsBuilder<TContext>

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

useLazyLoadingProxies
Boolean

true to use lazy loading proxies; false to prevent their use.

Returns

The same builder to allow method calls to be chained.

Remarks

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.

See Lazy loading for more information and examples.

Applies to

Entity Framework Core 9.0 i druge verzije
Proizvod Verzije
Entity Framework Core 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0