2013-02-10 55 views
1

是否正常?如果我将动态更改EF 4.3中ProxyCreationEnabled配置的值?动态更改ProxyCreationEnabled




    somecontext.Configuration.ProxyCreationEnabled = false; 
    somecontext.Set().Get(id); 
    somecontext.Configuration.ProxyCreationEnabled = true; 
    ... 

回答

1

是的。实际上,在运行时更改代理创建或延迟加载配置有时非常有用。