开发者

Revert chages in EntityCollection on click of cancel

开发者 https://www.devze.com 2023-01-28 12:13 出处:网络
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 entitycollectio

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消