Mid EF Core

Can you disable lazy loading?

How?

Yes.

You can disable lazy loading globally:

options.UseLazyLoadingProxies(false);

Or don't install the proxy package at all.

You can also disable it for specific navigation properties by not making them virtual.

More from Entity Framework Core Tutorial

All questions for this course