Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi ,

I am using Entity framework. For some reason there is always a need to add below line in my entity.context.cs file

this.Configuration.ProxyCreationEnabled = false;


C#
public partial class ABC: DbContext
    {
        public ABC()
            : base("name=ABC")
        {
            this.Configuration.LazyLoadingEnabled = false;
            this.Configuration.ProxyCreationEnabled = false;
        }


But the problem of adding this line in this autogenrated file is everytime if i have to update my model .. this chnages gone and i have to keep remeber that i have add this line again which is hectic .

Is there any way where we can store this setting where it cant be chnaged
Posted
Updated 4-Jan-16 20:02pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900