public void get_records_by_partition_key_paged_using_maximum_page_size()
        {
            var tableStore = new TableStore <TestTableEntity>("recordsbypartmaxpage", ConnectionString, _tableStorageOptions);

            for (int i = 0; i < 11; i++)
            {
                var records = new List <TestTableEntity>();
                for (int j = 0; j < 100; j++)
                {
                    records.Add(new TestTableEntity($"{i}_{j}", "x"));
                }
                tableStore.Insert(records);
            }

            var results         = tableStore.GetByPartitionKeyPaged("x", pageSize: 1000);
            var nextPageResults =
                tableStore.GetByPartitionKeyPaged("x", pageSize: 1000,
                                                  continuationTokenJson: results.ContinuationToken);

            results.Items.Count.Should().Be(1000);
            nextPageResults.Items.Count.Should().Be(100);
            nextPageResults.IsFinalPage.Should().BeTrue();

            tableStore.DeleteTable();
        }
Beispiel #2
0
        /// <summary>
        /// ets the records by partition key async
        /// </summary>
        /// <param name="partitionKey">The partition key.</param>
        /// <param name="filter">The filter.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="continuationTokenJson">The continuation token json.</param>
        /// <returns>PagedResult&lt;T&gt;.</returns>
        public PagedResult <T> GetByPartitionKeyPaged(string partitionKey, Func <T, bool> filter, int pageSize = 100,
                                                      string continuationTokenJson = null)
        {
            var result = _tableStore.GetByPartitionKeyPaged(partitionKey, pageSize, continuationTokenJson);

            return(CreatePagedResult(result, filter));
        }