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)); }
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)); }
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 }); }
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 }); }
public override StorageQueryResult <T> ExecuteQuery(string context, int?pageSize = null) { var queryContext = TableStorageQueryContext.Create(context, pageSize); return(ExecuteQuery(queryContext)); }
public override async Task <StorageQueryResult <T> > ExecuteQueryAsync(string context, int?pageSize = null) { var queryContext = TableStorageQueryContext.Create(context, pageSize); return(await ExecuteQueryAsync(queryContext).ConfigureAwait(false)); }