Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save sandrinodimattia/4082081 to your computer and use it in GitHub Desktop.
Reading with DictionaryTableEntity
TableQuery<DictionaryTableEntity> query =
new TableQuery<DictionaryTableEntity>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "MSFT"));
var microsoftMetadata = customersMetadataTable.ExecuteQuery(query);
foreach (var record in microsoftMetadata)
{
Console.WriteLine("Processing: {0}", record.RowKey);
if (record.RowKey.StartsWith("ADDRESS"))
{
Console.WriteLine(" > This is an address");
Console.WriteLine(" - Street: {0}", record["street"].StringValue);
Console.WriteLine(" - City: {0}", record["city"].StringValue);
}
else if (record.RowKey.StartsWith("WEBSITE"))
{
Console.WriteLine(" > This is an website");
Console.WriteLine(" - Url: {0}", record["url"].StringValue);
}
Console.WriteLine(" > All properties");
foreach (var property in record)
Console.WriteLine(" - {0}: {1}", property.Key, property.Value.StringValue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment