Update Operations

Update an ODataEntity using the ScheduleUpdateEntity method on the ODataStore.

Use the DeepCopy() method to make a real copy (as opposed to a reference copy) of an entity. Make the necessary updates on the real copy of the ODataEntity. This ensures the original entity remains intact and the app maintains a consistent state, even if the update operation fails (network disconnects, server error, and so on).
  1. Create a deep copy of an existing entity to a temporary ODataEntity variable.
  2. Update the properties of the temporary ODataEntity variable (copiedEntity).
  3. Call the ScheduleUpdateEntity method on the ODataStore. Await on the Response property.
var copiedEntity = entity.DeepCopy();            
copiedEntity.Properties["Name"].Value = newName;

var execution = Store.ScheduleUpdateEntity(copiedEntity);
await execution.Response;