Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created November 15, 2012 22:30
Show Gist options
  • Select an option

  • Save sandrinodimattia/4081859 to your computer and use it in GitHub Desktop.

Select an option

Save sandrinodimattia/4081859 to your computer and use it in GitHub Desktop.
Working with the DirectoryTableEntity
CloudTable customersMetadataTable = tableClient.GetTableReference("customersmetadata");
customersMetadataTable.CreateIfNotExists();
var msftAddress1 = new DictionaryTableEntity();
msftAddress1.PartitionKey = "MSFT";
msftAddress1.RowKey = "ADDRESS-" + Guid.NewGuid().ToString("N").ToUpper();
msftAddress1.Add("city", "Seattle");
msftAddress1.Add("street", "111 South Jackson");
var msftWebsite1 = new DictionaryTableEntity();
msftWebsite1.PartitionKey = "MSFT";
msftWebsite1.RowKey = "WEBSITE-" + Guid.NewGuid().ToString("N").ToUpper();
msftWebsite1.Add("url", "http://www.microsoft.com");
var msftWebsite2 = new DictionaryTableEntity();
msftWebsite2.PartitionKey = "MSFT";
msftWebsite2.RowKey = "WEBSITE-" + Guid.NewGuid().ToString("N").ToUpper();
msftWebsite2.Add("url", "http://www.windowsazure.com");
var batch = new TableBatchOperation();
batch.Add(TableOperation.Insert(msftAddress1));
batch.Add(TableOperation.Insert(msftWebsite1));
batch.Add(TableOperation.Insert(msftWebsite2));
customersMetadataTable.ExecuteBatch(batch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment