Now that we have covered the basics, let's check some advanced topics that we will come across in live project developments.
When working with RIA Services, something of a data island is brought client side. We can work with it and, once we are ready, send it to the server. What happens if we want to cancel changes and start again? For instance, a user is modifying a client file and realizes that they are working on the wrong client, so they want to cancel the changes made. The entities with which we are working implement the IRrevertibleChangeTracking
. This interface defines a method named Reject,
which restores the affected entity and the associated ones (if applicable) to the original value.
In this case, if changes are to be cancelled, it will only be necessary to implement the following code lines (to see it working, press the button Cancel Changes in the sample application):
// Let us clear the current validation list CurrentSelectedClient.ValidationErrors...