Collections
We briefly introduced MementoEntity and MementoEntityCollection and seen how to track changes in a simple graph.
We can go further and introduce collection change tracking:
The MementoEntityCollection<T>
being a memento entity will keep track of changes applied to collection structure. Each change will be tracked, starting from Add
and Remove
to Clear
, Insert
, InsertAt
, etc...
Adding a MementoEntity
, such as Person
, will automatically trigger the memento that will start tracking the Person
instance:
As expected the changes stack is handled in the correct order. The next step is to understand how to handle change tracking in complex objects graph.
Last updated