Question
Hello EF Core Team,
I have a question regarding the behavior of AutoInclude in Entity Framework Core that I could not find clearly documented.
Specifically:
• When configuring AutoInclude via the ModelBuilder for an entity, it works fine when querying directly from the DbSet of that entity.
• However, when that entity is a child (nested inside another entity), AutoInclude does not seem to automatically load the nested navigation properties unless the query starts from the DbSet of the child entity itself.
Could you clarify:
• Is this the intended behavior for AutoInclude?
• Is there any way to configure AutoInclude to work similarly to Include() + ThenInclude() automatically for nested navigations?
• Or is explicit Include/ThenInclude chaining still required when navigating through multiple levels?
Some official documentation or deeper guidance around this behavior would be very helpful, especially when designing domain models with aggregates and nested entities.
Thank you for your time and for your work on EF Core!
Your code
Stack traces
Verbose output
EF Core version
9.0.4
Database provider
Microsoft.EntityFrameworkCore.SqlServer
Target framework
.NET 9.0
Operating system
macOS
IDE
Rider 2025.1
Question
Hello EF Core Team,
I have a question regarding the behavior of AutoInclude in Entity Framework Core that I could not find clearly documented.
Specifically:
• When configuring AutoInclude via the ModelBuilder for an entity, it works fine when querying directly from the DbSet of that entity.
• However, when that entity is a child (nested inside another entity), AutoInclude does not seem to automatically load the nested navigation properties unless the query starts from the DbSet of the child entity itself.
Could you clarify:
• Is this the intended behavior for AutoInclude?
• Is there any way to configure AutoInclude to work similarly to Include() + ThenInclude() automatically for nested navigations?
• Or is explicit Include/ThenInclude chaining still required when navigating through multiple levels?
Some official documentation or deeper guidance around this behavior would be very helpful, especially when designing domain models with aggregates and nested entities.
Thank you for your time and for your work on EF Core!
Your code
Stack traces
Verbose output
EF Core version
9.0.4
Database provider
Microsoft.EntityFrameworkCore.SqlServer
Target framework
.NET 9.0
Operating system
macOS
IDE
Rider 2025.1