Setting ProxyCreationEnabled on the EF5 Context

Posts   
 
    
ianvink
User
Posts: 393
Joined: 15-Dec-2006
# Posted on: 12-Dec-2013 19:45:23   

I'd like to have the DBContext set ProxyCreationEnabled = false always.

Is there a way to have that enabled in the Designer (v4.1) ?

Ian

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 13-Dec-2013 10:08:48   

There's no setting for that in the designer. You can add it yourself: create a partial class for the generated DbContext class and implement OnContextCreated. It's a partial method which by default has no code, so you can simply implement it in the partial class and it will then be called in the ctor. Then set the properties you want in that method.

Frans Bouma | Lead developer LLBLGen Pro