2013-02-10 53 views
1

是否正常?如果我將動態更改EF 4.3中ProxyCreationEnabled配置的值?動態更改ProxyCreationEnabled




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

回答

1

是的。實際上,在運行時更改代理創建或延遲加載配置有時非常有用。