Will Franklin

Will Franklin

  • NA
  • 11
  • 1.3k

Dependeny injection and ProxyCreationEnabled=false

Jan 25 2018 7:05 AM
Hi,
 
In order not to generate JSON circular reference problems when using Entity Framework I normally insert this line in my database context "this.Configuration.ProxyCreationEnabled = false;".
 
However, since it's recommended to register the database context with dependency injection as follows "services.AddDbContext(options => options.UseSqlServer(connection));" where do I set the proxy to false?

Answers (1)