Skip to content

Document AsNoTracking requirement when querying owned entities without the owner - #5554

Open
AhmedMohamedGaber wants to merge 2 commits into
dotnet:mainfrom
AhmedMohamedGaber:patch-owned-entities-asnotracking
Open

AhmedMohamedGaber wants to merge 2 commits into
dotnet:mainfrom
AhmedMohamedGaber:patch-owned-entities-asnotracking

Conversation

@AhmedMohamedGaber

Copy link
Copy Markdown
Contributor

Fixes #2205.

The EF Core 3.0 breaking changes page covers this, but the Owned Entity Types page itself doesn't mention it, so people still trip over the exception when they project an owned entity without its owner. I added a short note to the "Querying owned types" section: a tracking query that projects an owned entity without its owner throws, and the fix is AsNoTracking for read-only queries or projecting the owner when the owned instance needs to be tracked. Happy to reword or move it if you prefer it somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document: OwnedEntities requires AsNoTracking when queried separately

1 participant