コード例 #1
0
        private StorageQueryResult <T> ExecuteQuery(TableQuery query)
        {
            var context = new TableStorageQueryContext
            {
                ContinuationInfo = new TableStorageContinuationInfo
                {
                    Query         = query,
                    PageSize      = query.TakeCount ?? DEFAULT_PAGE_SIZE,
                    HasMoreResult = true
                },
            };

            return(ExecuteQuery(context));
        }
コード例 #2
0
        private async Task <StorageQueryResult <T> > ExecuteQueryAsync(TableQuery query)
        {
            var context = new TableStorageQueryContext
            {
                ContinuationInfo = new TableStorageContinuationInfo
                {
                    Query         = query,
                    PageSize      = query.TakeCount ?? DEFAULT_PAGE_SIZE,
                    HasMoreResult = true
                },
            };

            return(await ExecuteQueryAsync(context).ConfigureAwait(false));
        }
コード例 #3
0
        private async Task <StorageQueryResult <T> > ExecuteQueryAsync(TableStorageQueryContext queryContext)
        {
            var table = await TableAsync().ConfigureAwait(false);

            var result = await table.ExecuteQuerySegmentedAsync(queryContext.ContinuationInfo.Query, queryContext.ContinuationInfo.ContinuationToken).ConfigureAwait(false);

            queryContext.ContinuationInfo.ContinuationToken = result.ContinuationToken;
            queryContext.ContinuationInfo.HasMoreResult     = result.ContinuationToken != null;
            var records = result.Results.Select(d => BSonConvert.DeserializeObject <T>(d.Properties["Content"].BinaryValue));

            return(new StorageQueryResult <T>
            {
                QueryContext = BSonConvert.SerializeToBase64String(queryContext),
                Records = records,
                HasMoreResult = queryContext.HasMoreResult
            });
        }
コード例 #4
0
        private StorageQueryResult <T> ExecuteQuery(TableStorageQueryContext queryContext)
        {
            var table             = Table();
            var continuationInfos = new List <TableStorageContinuationInfo>();

            var result = table.ExecuteQuerySegmented(queryContext.ContinuationInfo.Query, queryContext.ContinuationInfo.ContinuationToken);

            queryContext.ContinuationInfo.ContinuationToken = result.ContinuationToken;
            queryContext.ContinuationInfo.HasMoreResult     = result.ContinuationToken != null;
            var records = result.Results.Select(d => BSonConvert.DeserializeObject <T>(d.Properties["Content"].BinaryValue));

            return(new StorageQueryResult <T>
            {
                Contexts = BSonConvert.SerializeToBase64String(queryContext),
                Records = records,
                HasMoreResult = queryContext.HasMoreResult
            });
        }
コード例 #5
0
        public override StorageQueryResult <T> ExecuteQuery(string context, int?pageSize = null)
        {
            var queryContext = TableStorageQueryContext.Create(context, pageSize);

            return(ExecuteQuery(queryContext));
        }
コード例 #6
0
        public override async Task <StorageQueryResult <T> > ExecuteQueryAsync(string context, int?pageSize = null)
        {
            var queryContext = TableStorageQueryContext.Create(context, pageSize);

            return(await ExecuteQueryAsync(queryContext).ConfigureAwait(false));
        }