开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜