Skip to content

I believe it's worth mentioning EF is capable of detecting replacements of owned entities. #4981

Description

@voroninp

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

Activity

  1. added this to the 11.0.0 milestone on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions