Advertisement
Guest User

Untitled

a guest
May 27th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. using Microsoft.WindowsAzure.Storage;
  2. using Microsoft.WindowsAzure.Storage.Table;
  3.  
  4. public void ShipOrder(CloudStorageAccount storageAccount, string partitionKey, string rowKey)
  5. {
  6. CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
  7. CloudTable table = tableClient.GetTableReference("orders");
  8. TableOperation retrieveOperation = TableOperation.Retrieve<OrderEntity>(partitionKey, rowKey);
  9. TableResult retrievedResult = table.Execute(retrieveOperation);
  10. OrderEntity toUpdate = (OrderEntity) retrievedResult.Result;
  11. if (toUpdate != null)
  12. {
  13. toUpdate.Status = "shipped";
  14. toUpdate.ShippedDate = Convert.ToDateTime("20150417");
  15. TableOperation insertOrReplaceOperation = TableOperation.InsertOrReplace(toUpdate);
  16. table.Execute(insertOrReplaceOperation);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement