Exemplo n.º 1
0
        public static Task <PartitionedQueryExecutionInfo> GetQueryPlanThroughGatewayAsync(
            CosmosQueryClient client,
            SqlQuerySpec sqlQuerySpec,
            Uri resourceLink,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            if (sqlQuerySpec == null)
            {
                throw new ArgumentNullException(nameof(sqlQuerySpec));
            }

            if (resourceLink == null)
            {
                throw new ArgumentNullException(nameof(resourceLink));
            }

            cancellationToken.ThrowIfCancellationRequested();

            return(client.ExecuteQueryPlanRequestAsync(
                       resourceLink,
                       ResourceType.Document,
                       OperationType.QueryPlan,
                       sqlQuerySpec,
                       QueryPlanRetriever.SupportedQueryFeaturesString,
                       cancellationToken));
        }
        public static Task <PartitionedQueryExecutionInfo> GetQueryPlanThroughGatewayAsync(
            CosmosQueryClient client,
            SqlQuerySpec sqlQuerySpec,
            Uri resourceLink,
            CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            return(client.ExecuteQueryPlanRequestAsync(
                       resourceLink,
                       ResourceType.Document,
                       OperationType.QueryPlan,
                       sqlQuerySpec,
                       QueryPlanRetriever.SupportedQueryFeaturesString,
                       cancellationToken));
        }