dotnet / dotnet/efcore

How to fix up navigation collection without reloading?

Open
#30,147 1 comment 0 reactions 0 assignees View on GitHub
area-change-tracking customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

Hello. I have two navigation collections contains common entity inside. Atter I reloaded one of them, other navigation collection sill contains detached entity. I tried to fix it using ChangeTracker.DetectChanges() method, but unsuccessfully.
How can I replace new entity in other collection without querying database?
[RefreshDetachedIssueSample.zip](https://github.com/dotnet/efcore/files/10508437/RefreshDetachedIssueSample.zip)

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.