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
If an instance of an owned entity is replaced with a new instance that has the same primary key, EF will detect the replacement and issue an update.
In contrast, if this were a regular navigation property, EF would raise an error, indicating an attempt to track multiple entities with the same identifier.
This highlights a significant difference in behavior between HasOne/HasMany and OwnsOne/OwnsMany.
Type of issue
Missing information
Description
If an instance of an owned entity is replaced with a new instance that has the same primary key, EF will detect the replacement and issue an update.
In contrast, if this were a regular navigation property, EF would raise an error, indicating an attempt to track multiple entities with the same identifier.
This highlights a significant difference in behavior between HasOne/HasMany and OwnsOne/OwnsMany.
Page URL
https://learn.microsoft.com/en-us/ef/core/modeling/owned-entities
Content source URL
https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/modeling/owned-entities.md
Document Version Independent Id
e3effbd0-07f2-423d-4032-1722e75adb37
Article author
@AndriySvyryd
The text was updated successfully, but these errors were encountered: