Tuesday, February 9, 2010

WCF RIA Services – Short Notes – Refreshing data from the server

By default if an Entity arriving from the server has the same Identity has one already in the DomainContexts at the client it is discarded. This behavior can be changed by calling the Load method of the DomainContext giving a MergeOption. It can be:

  1. MergeOption.OverwriteCurrentValues – What is comming from the server overrides the changes on the client.
  2. MergeOption.KeepCurrentValues – What is on the client remains the same what comes from the server is discarded.
  3. MergeOption.KeepChanges – Changes that where made on the client are maintained and everything else is replaced from what is on the server.

Have fun,