Entity Snapshot

Apr 16, 2015 at 9:20 PM
Is there any way that i can make a SnapShot of a entity and if the user cancels i revert back?

I have found cancel changes, in the EntityHelper but what i need is, take a snapshot of the entity, make changes and revert if necessary even if it is a new entity

Regards
Apr 16, 2015 at 9:30 PM
If it is a new entity, you can simply call session.DeleteEntity - calling this on new entity effectively removes it from update set, no changes will be pushed to the database.

For existing entity use this:

EntityHelper.GetRecord(ent).CancelChanges();