Rakesh
Rakesh

Reputation: 310

Revert chages in EntityCollection on click of cancel

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

Answers (2)

ASpirin
ASpirin

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

synepis
synepis

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

Related Questions