dotnet / EntityFramework.Docs

Documentation for Entity Framework Core and Entity Framework 6
https://docs.microsoft.com/ef/
Creative Commons Attribution 4.0 International
1.62k stars 1.96k forks source link

Suggest change to clarify access modifier required when using Lazy Loading Proxies #984

Open geoffRGWilliams opened 6 years ago

geoffRGWilliams commented 6 years ago

When combining entity type constructors with lazy-loading proxies (enabled via a call to UseLazyLoadingProxies(true)), model constructors must be at a minimum protected, or exceptions will be thrown.

Suggest changing this line:

The constructor can be public, private, or have any other accessibility.

to:

The constructor can be public, private, or have any other accessibility. However when using Lazy Loading Proxies the constructor must be, at minimum, protected.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

orionstudt commented 5 years ago

Seconded - this post just helped me resolve my issue, thank you.