在新配置下在EF7中切换ProxyCreation [英] Toggling ProxyCreation in EF7 under new configuration
问题描述
因此在EF6中,可以像这样禁用代理创建:
So in EF6, one could disable proxy creation like so:
this.Configuration.ProxyCreationEnabled = false;
根据我的发现,EF7下的配置方案已更改,但我找不到如何这样做。我经历了 https://docs.efproject.net/en/latest/ miscellaneous / configuring-dbcontext.html 甚至分析了DbContextOptionsBuilder对象,但找不到任何对象。
From what I could find, the configuration scheme under EF7 has changed, but I cannot find anything on how to do so. I went through https://docs.efproject.net/en/latest/miscellaneous/configuring-dbcontext.html and even analyzed the DbContextOptionsBuilder object, but cannot find anything on it.
我会以错误的方式进行操作吗?还是我缺少某些内容?
Am I going about ti the wrong way or is there something im missing? Thanks in advance.
推荐答案
EF7 EF Core 1.0不会创建代理,因此相应地,没有为此的配置选项。参见 https://github.com/aspnet/EntityFramework/issues/997
EF7 EF Core 1.0 does not do proxy creation, so accordingly, there is no configuration option for this. See https://github.com/aspnet/EntityFramework/issues/997
这篇关于在新配置下在EF7中切换ProxyCreation的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!