Revert chages in EntityCollection on click of cancel
I have a wpf window wherein grid is bound to entityCollection. herein I add/dele开发者_开发问答te a record to grid and then click cancel button. How can I revert the chages made to the entitycollection.
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.
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.
精彩评论