0

What is the best place to keep lazyloading enable condition in my web application. Because when I am using database first approach of EF and when try to update the context then my all setting got wiped out. Below are my settings.

  public DBEntities(): base("name=DBEntities")
    {
        this.Configuration.ProxyCreationEnabled = true;
        this.Configuration.LazyLoadingEnabled = true;
    }

What is the best way so that these setting should not vanish after edmx update. Is there any chance to keep in global.asax. If yes what are its downsides?.

Rajaram Shelar
  • 7,537
  • 24
  • 66
  • 107

1 Answers1

0

Your placement looks fine. Note, that as Gert Arnold has stated, that these are defaulted to true.

So,

 public DBEntities(): base("name=DBEntities")
    { }

Is all you need for the sake of brevity here, excluding explicitness.

Mark C.
  • 6,332
  • 4
  • 35
  • 71