Esempio n. 1
0
        /// <summary>
        /// Allows you to perform a query on the against the table.
        /// Warning this could result in a table scan being executed.
        /// </summary>
        /// <param name="query">A TsQuery object containing a TableQuery.</param>
        /// <returns></returns>
        public async Task <IEnumerable <T> > QueryAsync(TsQuery query)
        {
            var returnList = new List <T>();
            TableContinuationToken continuationToken = null;
            var tableQuery = new TableQuery <T>().Where(query.Query).Take(MAX_BATCH_COUNT);

            do
            {
                var tableQueryResult = await _table.ExecuteQuerySegmentedAsync(tableQuery, continuationToken);

                returnList.AddRange(tableQueryResult.Results);
                continuationToken = tableQueryResult.ContinuationToken;
            }while (continuationToken != null);

            return(returnList);
        }
Esempio n. 2
0
        public async Task ShouldHaveCreatedRecordsInTable()
        {
            var actual = await _table.ExecuteQuerySegmentedAsync(new TableQuery <TestingEntity>().Take(1000), null);

            Assert.Equal(600, actual.Results.Count);
        }