1
Answer

Dependeny injection and ProxyCreationEnabled=false

Will Franklin

Will Franklin

7y
855
1
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)