1
Reply

Dependeny injection and ProxyCreationEnabled=false

Will Franklin

Will Franklin

Jan 25 2018 7:05 AM
131
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?

Upload Source Code  Select only zip and rar file.
Answers (1)