Shadow3188
Shadow3188

Reputation: 265

Toggling ProxyCreation in EF7 under new configuration

So in EF6, one could disable proxy creation like so:

this.Configuration.ProxyCreationEnabled = false;

From what I could find, the configuration scheme under EF7 has changed, but I cannot find anything on how to do so. I went through https://docs.efproject.net/en/latest/miscellaneous/configuring-dbcontext.html and even analyzed the DbContextOptionsBuilder object, but cannot find anything on it.

Am I going about ti the wrong way or is there something im missing? Thanks in advance.

Upvotes: 8

Views: 3217

Answers (2)

Robin Ding
Robin Ding

Reputation: 911

Entity Framework Core 2.1 starts to support Lazy load. Please see: https://learn.microsoft.com/en-us/ef/core/querying/related-data#lazy-loading

Here is recent question with answers from stackoverflow: What is the equivalent of .Configuration.ProxyCreationEnabled in EF Core?

Upvotes: 0

natemcmaster
natemcmaster

Reputation: 26773

EF7 EF Core 1.0 does not do proxy creation, so accordingly, there is no configuration option for this. See https://github.com/aspnet/EntityFramework/issues/997

Upvotes: 9

Related Questions