dotnet / dotnet/EntityFramework.Docs

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

Open
#1,856 1 comment 0 reactions 0 assignees View on GitHub
area-query-related-data
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

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.*

* ID: bbd36f35-e257-d0ed-8f28-f539ddcb71ec
* Version Independent ID: 093903d5-f7c7-5a78-c0e5-0e2662dcedef
* Content: [Loading Related Data - EF Core](https://docs.microsoft.com/en-us/ef/core/querying/related-data#feedback)
* Content Source: [entity-framework/core/querying/related-data.md](https://github.com/aspnet/EntityFramework.Docs/blob/master/entity-framework/core/querying/related-data.md)
* Product: **entity-framework**
* Technology: **entity-framework-core**
* GitHub Login: @rowanmiller
* Microsoft Alias: **avickers**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.