You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given 2 related entities Person and PersonDetail and executing a query with an Include() from Person to PersonDetail as follows, the corresponding navigation property has the IsLoaded value false
varp= context.Persons
.AsNoTracking().Include(p => p.PersonDetail).FirstAsync();
Assert.True(context.Entry(p).Navigation(nameof(Person.PersonDetail)).IsLoaded);// this assertion fails!
Expected behaviour
The assertion should not fail, because the navigation property was loaded as part of the query.
Include provider and version information
EF Core version: 7.0.2
Database provider: Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.InMemory
Target framework: .NET 6.0 / .NET 7.0
Operating system: Windows 10
IDE: Visual Studio 2022 17.4
@ajcvickers from what I have read in #10042, I understand that EF8 will be able to lazy fetch navigations starting from an untracked entity. Does it means that the DbContext will populate the IsLoaded property too?
Thanks very much for your support!
Actual behaviour
Given 2 related entities
Person
andPersonDetail
and executing a query with anInclude()
fromPerson
toPersonDetail
as follows, the corresponding navigation property has theIsLoaded
valuefalse
Expected behaviour
The assertion should not fail, because the navigation property was loaded as part of the query.
Include provider and version information
EF Core version: 7.0.2
Database provider: Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.InMemory
Target framework: .NET 6.0 / .NET 7.0
Operating system: Windows 10
IDE: Visual Studio 2022 17.4
Repro csproj: EF7AsNoTrackingBugTests.zip
The text was updated successfully, but these errors were encountered: