Reputation: 310
I have a wpf window wherein grid is bound to entityCollection. herein I add/delete a record to grid and then click cancel button. How can I revert the chages made to the entitycollection.
Upvotes: 1
Views: 88
Reputation: 3651
if your objects states were changed you can't do anything without reloading collection from server using with Overwrite option.
In better case you may use Memento pattern.
Upvotes: 1
Reputation: 1332
Doesn't EF require you to call SavChanges() before anything is saved in to the database? You don't need to add a cancel button but rather a save button.
Upvotes: 1