Reputation: 2380
I'm having the following issue with WCF RIA Services: I have a table Customer and a table Address. A customer can have 0...n addresses. There is a form for editing the customer, with a Datagrid that displays the addresses. You add / edit an address in a child window by clicking Add / Edit. Now here's the thing:
The problem is that the user should always be able to cancel edits. This is not a problem except: If you create a new customer and you add an address to that customer, then want to edit the address but want to cancel that edit.
How would you guys solve that?
Upvotes: 5
Views: 1057
Reputation: 2029
Entity implements IRevertibleChangeTracking to support this scenario. Since it's implemented explicitly, you'll have to cast it. The following code will work.
((IRevertibleChangeTracking)address).RejectChanges();
Upvotes: 6