Hi there,
I need to rollback changes made to an entity including related entities that exist on a parent entity.
The SaveFields and RollBackFields methods aren't sufficient as they only store the field information of the parent entity, and don't support rollback of entitycollections (that have had entities modified/added/deleted) or related entity objects.
To get around this I create a copy of the the entity using binary serialisation before it is modified. If the edit is canceled I then return the copy instead of the original modified entity.
Is this the best way to go about ensuring a complete rollback? Or is there a better alternative method?
Regards,
Demetri.