internal virtual Task <CosmosResponseMessage> NextResultSetDelegate(
            string continuationToken,
            string partitionKeyRangeId,
            int?maxItemCount,
            CosmosChangeFeedRequestOptions options,
            CancellationToken cancellationToken)
        {
            Uri resourceUri = this.cosmosContainer.LinkUri;

            return(ExecUtils.ProcessResourceOperationAsync <CosmosResponseMessage>(
                       client: this.cosmosContainer.Database.Client,
                       resourceUri: resourceUri,
                       resourceType: Documents.ResourceType.Document,
                       operationType: Documents.OperationType.ReadFeed,
                       requestOptions: options,
                       requestEnricher: request => {
                CosmosChangeFeedRequestOptions.FillContinuationToken(request, continuationToken);
                CosmosChangeFeedRequestOptions.FillMaxItemCount(request, maxItemCount);
                CosmosChangeFeedRequestOptions.FillPartitionKeyRangeId(request, partitionKeyRangeId);
            },
                       responseCreator: response => response,
                       partitionKey: null,
                       streamPayload: null,
                       cancellationToken: cancellationToken));
        }
Example #2
0
        public void CosmosChangeFeedRequestOptions_ContinuationIsSet()
        {
            CosmosRequestMessage           request        = new CosmosRequestMessage();
            CosmosChangeFeedRequestOptions requestOptions = new CosmosChangeFeedRequestOptions()
            {
            };

            CosmosChangeFeedRequestOptions.FillContinuationToken(request, "something");
            requestOptions.FillRequestOptions(request);

            Assert.AreEqual("something", request.Headers.IfNoneMatch);
            Assert.IsNull(request.Headers[Documents.HttpConstants.HttpHeaders.IfModifiedSince]);
        }