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
A recursive search of the navigation properties will be performed to find reachable entities that are not already being tracked by the context. All entities found will be tracked by the context.
but that's not what I'm observing with owned entities.
@the-ress The described behavior only happens when the parent is not being tracked when you call Update
The feature that might help your scenario is #10551
EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.
BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.
The documentation for DbContext.Update says
but that's not what I'm observing with owned entities.
Steps to reproduce
Run this code:
I expect the status to be
Added
, but it'sDetached
. (If I callcontext.ChangeTracker.DetectChanges()
, the state gets changed toAdded
.)Is my expectation correct, or am I misunderstanding the documentation?
Further technical details
EF Core version: 3.1.1
Database provider: Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.InMemory
Target framework: .NET Core 3.1
Operating system: Windows 10 (1803)
IDE: Visual Studio 2019 16.4.4
The text was updated successfully, but these errors were encountered: