本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Table.TableQuery.GenerateQueryBuilder方法的典型用法代码示例。如果您正苦于以下问题:C# TableQuery.GenerateQueryBuilder方法的具体用法?C# TableQuery.GenerateQueryBuilder怎么用?C# TableQuery.GenerateQueryBuilder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.WindowsAzure.Storage.Table.TableQuery
的用法示例。
在下文中一共展示了TableQuery.GenerateQueryBuilder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryImpl
private static RESTCommand<TableQuerySegment> QueryImpl(TableQuery query, TableContinuationToken token, CloudTableClient client, string tableName, TableRequestOptions requestOptions)
{
UriQueryBuilder builder = query.GenerateQueryBuilder();
if (token != null)
{
token.ApplyToUriQueryBuilder(builder);
}
StorageUri tempUriList = NavigationHelper.AppendPathToUri(client.StorageUri, tableName);
RESTCommand<TableQuerySegment> queryCmd = new RESTCommand<TableQuerySegment>(client.Credentials, tempUriList);
requestOptions.ApplyToStorageCommand(queryCmd);
queryCmd.CommandLocationMode = CommonUtility.GetListingLocationMode(token);
queryCmd.RetrieveResponseStream = true;
queryCmd.Handler = client.AuthenticationHandler;
queryCmd.BuildClient = HttpClientFactory.BuildHttpClient;
queryCmd.Builder = builder;
queryCmd.BuildRequest = (cmd, uri, queryBuilder, cnt, serverTimeout, ctx) => TableOperationHttpRequestMessageFactory.BuildRequestForTableQuery(uri, builder, serverTimeout, cnt, ctx);
queryCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp.StatusCode, null /* retVal */, cmd, ex);
queryCmd.PostProcessResponse = async (cmd, resp, ctx) =>
{
TableQuerySegment resSeg = await TableOperationHttpResponseParsers.TableQueryPostProcess(cmd.ResponseStream, resp, ctx);
if (resSeg.ContinuationToken != null)
{
resSeg.ContinuationToken.TargetLocation = cmd.CurrentResult.TargetLocation;
}
return resSeg;
};
return queryCmd;
}
示例2: QueryImpl
private static RESTCommand<TableQuerySegment> QueryImpl(TableQuery query, TableContinuationToken token, CloudTableClient client, string tableName, TableRequestOptions requestOptions)
{
Uri tempUri = NavigationHelper.AppendPathToUri(client.BaseUri, tableName);
UriQueryBuilder builder = query.GenerateQueryBuilder();
if (token != null)
{
token.ApplyToUriQueryBuilder(builder);
}
Uri reqUri = builder.AddToUri(tempUri);
RESTCommand<TableQuerySegment> queryCmd = new RESTCommand<TableQuerySegment>(client.Credentials, reqUri);
queryCmd.ApplyRequestOptions(requestOptions);
queryCmd.RetrieveResponseStream = true;
queryCmd.Handler = client.AuthenticationHandler;
queryCmd.BuildClient = HttpClientFactory.BuildHttpClient;
queryCmd.BuildRequest = (cmd, cnt, ctx) => TableOperationHttpRequestMessageFactory.BuildRequestForTableQuery(cmd.Uri, cmd.ServerTimeoutInSeconds, ctx);
queryCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp.StatusCode, null /* retVal */, cmd, ex);
queryCmd.PostProcessResponse = (cmd, resp, ctx) => TableOperationHttpResponseParsers.TableQueryPostProcess(cmd.ResponseStream, resp, ctx);
return queryCmd;
}
示例3: QueryImpl
private static RESTCommand<TableQuerySegment<DynamicTableEntity>> QueryImpl(TableQuery query, TableContinuationToken token, CloudTableClient client, string tableName, TableRequestOptions requestOptions)
{
Uri tempUri = NavigationHelper.AppendPathToUri(client.BaseUri, tableName);
UriQueryBuilder builder = query.GenerateQueryBuilder();
if (token != null)
{
token.ApplyToUriQueryBuilder(builder);
}
Uri reqUri = builder.AddToUri(tempUri);
RESTCommand<TableQuerySegment<DynamicTableEntity>> queryCmd = new RESTCommand<TableQuerySegment<DynamicTableEntity>>(client.Credentials, reqUri);
requestOptions.ApplyToStorageCommand(queryCmd);
queryCmd.RetrieveResponseStream = true;
queryCmd.SignRequest = client.AuthenticationHandler.SignRequest;
queryCmd.BuildRequestDelegate = TableOperationHttpWebRequestFactory.BuildRequestForTableQuery;
queryCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp != null ? resp.StatusCode : HttpStatusCode.Unused, null /* retVal */, cmd, ex, ctx);
queryCmd.PostProcessResponse = (cmd, resp, ex, ctx) =>
{
ResultSegment<DynamicTableEntity> resSeg = TableOperationHttpResponseParsers.TableQueryPostProcessGeneric<DynamicTableEntity>(cmd.ResponseStream, EntityUtilities.ResolveDynamicEntity, resp, ex, ctx);
return new TableQuerySegment<DynamicTableEntity>(resSeg);
};
return queryCmd;
}