dotnet / dotnet/EntityFramework.Docs

Missing information about "duplicate" data resolution

Open
#4,798 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

### Type of issue

Missing information

### Description

Maybe it is just me, but I don't see here information how data "duplication" is resolved for navigation properties.

Real-life scenario -- I have one table with words and another table with translations which is the list of pairs (word id + word id).

Now, imagine someone queries words and includes (via navigation property) translations **and** also includes words "back" (from navigation property of translation).

Without any resolving mechanism you will get multiple C# instances per single word record (because it may come directly from the table or indirectly from word->translation>word path).

And here what I miss in doc: information whether EF Core is resolving duplicate records, so I will get single C# instance for every word record. If yes -- i.e. EF Core tries to resolve this and creates "singleton" instances (i.e. one record -> one C# instance) -- is it configurable (and how)? Further "if yes" -- what are the limits of this resolution? The depth of navigation property (table A -> B -> C is resolved, but with 6 steps no?)? Memory, and so on?

*Thank you in advance for clarification.*

### Page URL

https://learn.microsoft.com/en-us/ef/core/querying/related-data/eager

### Content source URL

https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/querying/related-data/eager.md

### Document Version Independent Id

320e7305-e0a3-a1c6-77f2-1d3029b660b1

### Article author

@roji

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.