dotnet / EntityFramework.Docs

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

Clarify eager loading of multiple levels using a single .Include() #1856

Open samcarton opened 5 years ago

samcarton commented 5 years ago

Clarify the cases in which you can include multiple levels of related entities using a single include statement. In the Blogs example, instead of using .ThenInclude to include the Author's photo object you can go Blogs.Include(blog => blog.Author.Photo);. Specify that this can only be used to navigate through non-collection properties, if that is indeed the case.


Document Details

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

smitpatel commented 5 years ago

Specify that this can only be used to navigate through non-collection properties, if that is indeed the case.

If you can write it to compile, you can do it.