这种方式似乎不再可用。
public ApplicationDbContext()
{
this.Configuration.LazyLoadingEnabled = false;
}
最佳答案
延迟加载(当前)在 EF7 中不存在,因此没有可以禁用它的 API https://github.com/aspnet/EntityFramework/issues/3797
关于asp.net - 如何在 Entity Framework 7 中全局禁用延迟加载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34555962/