ProxiesExtensions.UseLazyLoadingProxies Method
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.
UseLazyLoadingProxies(DbContextOptionsBuilder, Action<LazyLoadingProxiesOptionsBuilder>) |
Turns on the creation of lazy loading proxies. |
UseLazyLoadingProxies(DbContextOptionsBuilder, Boolean) |
Turns on the creation of lazy loading proxies. |
UseLazyLoadingProxies<TContext>(DbContextOptionsBuilder<TContext>, Action<LazyLoadingProxiesOptionsBuilder>) |
Turns on the creation of lazy loading proxies. |
UseLazyLoadingProxies<TContext>(DbContextOptionsBuilder<TContext>, Boolean) |
Turns on the creation of lazy loading proxies. |
- Source:
- ProxiesExtensions.cs
- Source:
- ProxiesExtensions.cs
Turns on the creation of lazy loading proxies.
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseLazyLoadingProxies (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, Action<Microsoft.EntityFrameworkCore.LazyLoadingProxiesOptionsBuilder> lazyLoadingProxiesOptionsAction);
static member UseLazyLoadingProxies : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder * Action<Microsoft.EntityFrameworkCore.LazyLoadingProxiesOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
<Extension()>
Public Function UseLazyLoadingProxies (optionsBuilder As DbContextOptionsBuilder, lazyLoadingProxiesOptionsAction As Action(Of LazyLoadingProxiesOptionsBuilder)) As DbContextOptionsBuilder
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 and Entity Framework Core 8.0
Product | Versions |
---|---|
Entity Framework Core | 8.0, 9.0 |
- 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.
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
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 and other versions
Product | Versions |
---|---|
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.
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseLazyLoadingProxies<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, Action<Microsoft.EntityFrameworkCore.LazyLoadingProxiesOptionsBuilder> lazyLoadingProxiesOptionsAction) where TContext : Microsoft.EntityFrameworkCore.DbContext;
static member UseLazyLoadingProxies : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> * Action<Microsoft.EntityFrameworkCore.LazyLoadingProxiesOptionsBuilder> -> 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), lazyLoadingProxiesOptionsAction As Action(Of LazyLoadingProxiesOptionsBuilder)) As DbContextOptionsBuilder(Of TContext)
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 and Entity Framework Core 8.0
Product | Versions |
---|---|
Entity Framework Core | 8.0, 9.0 |
- 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.
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
- 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 and other versions
Product | Versions |
---|---|
Entity Framework Core | 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback: