Skip to content

Instantly share code, notes, and snippets.

@gbellmann
Created April 17, 2015 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbellmann/8c005601481d3fabf5af to your computer and use it in GitHub Desktop.
Save gbellmann/8c005601481d3fabf5af to your computer and use it in GitHub Desktop.
Function that gets all records in a partition
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
public void GetFromPartition(CloudStorageAccount storageAccount, string partitionKey)
{
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
CloudTable table = tableClient.GetTableReference("orders");
TableQuery<OrderEntity> query = new TableQuery<OrderEntity>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparison.Equal, partitionKey));
foreach (OrderEntity entity in table.ExecuteQuery(query))
{
// Do something
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment