src/TableAccess.cs
/// <summary>
/// Find all the items with a given partition key.
/// </summary>
/// <param name="partitionKey">The partition key.</param>
/// <returns>A readonly collection of all the items in the partition.</returns>
Find all the items with a given partition key.
Find all the items with a given partition key .
public async Task<IReadOnlyCollection<T>> FindAllByPartitionKey(string partitionKey)
        {
            if (string.IsNullOrWhiteSpace(partitionKey))
            {
                return new ReadOnlyCollection<T>(new List<T>());
            }
            await this.CreateIfNotExists();
            string filter = TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, partitionKey);
            TableQuery<T> query = new TableQuery<T>().Where(filter);
            var continuationToken = default(TableContinuationToken);
            List<T> results = new List<T>();
            do
            {
                TableQuerySegment<T> segment = await this.CloudTable.ExecuteQuerySegmentedAsync<T>(query, continuationToken);
                continuationToken = segment.ContinuationToken;
                results.AddRange(segment.Results);
            }
            while (continuationToken != null);
            return new ReadOnlyCollection<T>(results);
        }
public async Task < IReadOnlyCollection < T > > FindAllByPartitionKey ( string partitionKey ) { if ( string . IsNullOrWhiteSpace ( partitionKey ) ) { return new ReadOnlyCollection < T > ( new List < T > ( ) ) ; } await this . CreateIfNotExists ( ) ; string filter = TableQuery . GenerateFilterCondition ( " " , QueryComparisons . Equal , partitionKey ) ; TableQuery < T > query = new TableQuery < T > ( ) . Where ( filter ) ; var continuationToken = default ( TableContinuationToken ) ; List < T > results = new List < T > ( ) ; do { TableQuerySegment < T > segment = await this . CloudTable . ExecuteQuerySegmentedAsync < T > ( query , continuationToken ) ; continuationToken = segment . ContinuationToken ; results . AddRange ( segment . Results ) ; } while ( continuationToken != null ) ; return new ReadOnlyCollection < T > ( results ) ; }
Find all the items with a given partition key.
Find all the items with a given partition key .
A readonly collection of all the items in the partition.
A readonly collection of all the items in the partition .
partitionKey
string
The partition key.
The partition key .