NotifyChangedEvent for TDynamicProperties

I have two entities with a 1:1 relationship. When Entity B is updated, the ChangedOn and ChangedBy fields of Entity A should be updated as well.

I am calling EntityManager.SaveOrUpdate on Entity A, and Entity B is updated via cascade.

How can I ensure that ChangedOn and ChangedBy are updated in TDynamicProperties when this happens?

Using OnUpdating on Entity B does not work, because Entity A is already updated...

Maybe a new event on TDynamicProperties could help, that is called if value was changed

How does TDynamicProperties relate to this? Would it be any different if the fields were not in dynamic properties but in the entity itself?

Associations in Aurelius can be bidirectional, so you can choose which side you want to use the OnUpdating event. Nevertheless the events are per entity, not global. You still have to have a "higher level" of abstraction to eventually call Flush in the modified entities that are not part of the event.

Well, for all fields I'm able to switch XData and Dataset using the corresponding properties, handling this within the setters.

You're right, that I could solve this outside of my Entities. But I don't know, how to deal with this using CRUD-Endpoints.

Patch / Put on Entity B for example should also modify changed fields on Entity A...

What if you use XData server-side events, instead of Aurelius ones? There you might be able to simply directly modify other entities.