Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.WindowsAzure.Storage;
- using Microsoft.WindowsAzure.Storage.Table;
- public void ShipOrder(CloudStorageAccount storageAccount, string partitionKey, string rowKey)
- {
- CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
- CloudTable table = tableClient.GetTableReference("orders");
- TableOperation retrieveOperation = TableOperation.Retrieve<OrderEntity>(partitionKey, rowKey);
- TableResult retrievedResult = table.Execute(retrieveOperation);
- OrderEntity toUpdate = (OrderEntity) retrievedResult.Result;
- if (toUpdate != null)
- {
- toUpdate.Status = "shipped";
- toUpdate.ShippedDate = Convert.ToDateTime("20150417");
- TableOperation insertOrReplaceOperation = TableOperation.InsertOrReplace(toUpdate);
- table.Execute(insertOrReplaceOperation);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement