Person
and its PersonViewModel
editor it is straightforward at save time simply copy back all the properties from the ViewModel
to the model.ChangeTrackingService
we need to understand what has happened to the collection structure in order to:IAdvisory
to understand what has happened during the editing phase:Address
class type and we are filtering Address instances looking only for items that should be deleted, that means that have been removed from a memento collection.Topics.Radical.ChangeTracking
namespace;GetNewItems<T>()
retrieve the list of added items of the given type T;GetChangedItems<T>()
retrieve the list of changed items of the given type T that were already exiting;GetDeletedItems<T>()
retrieve the list of deleted items of the given type T;GetRemovedItems<T>()
retrieve the list of removed items of the given type T;Deleted
items are items that we initially load into the collection, we can call them persistent, that were removed during the editing phase;Removed
items are items that were created during the editing phase, transient items, and then removed from the collections, most of the time this type of items can be safely ignored since their existence do not affect the persistent storage;