Repository navigation
Replies: 1 comment
|
I worked around this scenario. As EF core owned type is treated as complex/value objects and are part of the parent entity , they do not appear as separate entries in Once detect changes in any owned property , you can then manually updates the parent entity's ModifiedAt or trigger domain-level logic. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm using EF Core 10.0.2. I have a Supplier entity with an Address owned type (record). I have decorated the Supplier with an IHasModifiedAt interface, which is used in a SaveChangesInterceptor to automatically set a ModifiedAt property whenever the Supplier is updated.
It works great when primitive properties on Supplier are changed. However, if an owned type (e.g. Address) is updated, and no primitives on the parent (e.g. Supplier) are changed, the parent entity does not reflect a Modified state. The values for the modified owned type are persisted even though the parent entity reflected an Unchanged state.
I tried looking at entry properties to see if they were modified (see below), but owned types must not be included:
Any thoughts on how to update a parent entity decorated with IHasModifiedAt, when the values of an owned type (record) are updated?
All reactions