Created
November 15, 2012 22:30
-
-
Save sandrinodimattia/4081859 to your computer and use it in GitHub Desktop.
Working with the DirectoryTableEntity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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