Cant Disable Lazy Loading and Proxy Creation on DbContext EFCore

asp.net asp.net-core-mvc c# entity-framework entity-framework-core

Question

Is there a way to disable lazy Loading on EntityFramework.Core

In my previous code I have done the following :

  public DataContext(string nameOrConnectionString) : base(nameOrConnectionString)
    {

        Configuration.LazyLoadingEnabled = false;
        Configuration.ProxyCreationEnabled = false;
    }

but now using the new ef 7 i cant find any option to do so

public DataContext(DbContextOptions<DataContext> options) : base(options)
    {
        //should have been in the options
    }
1
2
6/28/2016 4:45:00 PM

Popular Answer

As of 2019 Lazy Loading is supported but not enabled by default, so there is nothing that you need to do still.

3
1/18/2019 7:41:57 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow