Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the interaction between filtered includes and change tracking #2307

Closed
roji opened this issue Apr 21, 2020 · 0 comments · Fixed by #2835
Closed

Clarify the interaction between filtered includes and change tracking #2307

roji opened this issue Apr 21, 2020 · 0 comments · Fixed by #2835

Comments

@roji
Copy link
Member

roji commented Apr 21, 2020

With filtered includes, there can now be some tricky situations where users load a filtered subset of dependents, and then attempt to add a new entity which already exists in the database. Since EF isn't aware of that entity, an INSERT will be generated and will fail. With regular include, this doesn't happen because EF knows about all the dependents from change tracking, so a different exception is raised etc. It may be worth adding a bit of guidance on this.

@smitpatel also informed me that with filtered include we consider the relationship to be loaded, e.g. for lazy-loading purposes. This should probably also be mentioned.

/cc @maumar @ajcvickers

@maumar maumar self-assigned this Apr 21, 2020
@ajcvickers ajcvickers added this to the 5.0.0 milestone Apr 24, 2020
maumar added a commit that referenced this issue Nov 6, 2020
Fixes #486
Fixes #756
Fixes #1311
Fixes #2307
Fixes #2511
Fixes #2731
Fixes #2823
maumar added a commit that referenced this issue Nov 6, 2020
Fixes #486
Fixes #756
Fixes #1311
Fixes #2307
Fixes #2511
Fixes #2731
Fixes #2823
maumar added a commit that referenced this issue Nov 6, 2020
Fixes #486
Fixes #756
Fixes #1311
Fixes #2307
Fixes #2511
Fixes #2731
Fixes #2823
maumar added a commit that referenced this issue Nov 6, 2020
Fixes #486
Fixes #756
Fixes #1311
Fixes #2307
Fixes #2511
Fixes #2731
Fixes #2823
maumar added a commit that referenced this issue Nov 9, 2020
Fixes #486
Fixes #756
Fixes #1311
Fixes #2307
Fixes #2511
Fixes #2731
Fixes #2823
maumar added a commit that referenced this issue Nov 9, 2020
Fixes #486
Fixes #756
Fixes #1311
Fixes #2307
Fixes #2511
Fixes #2731
Fixes #2823
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants