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
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