Table of Contents

Interface IDocumentQuery<T>

Namespace
Microsoft.Azure.Documents.Linq
Assembly
Microsoft.Azure.Documents.Client.dll

Provides methods to support query pagination and asynchronous execution in the Azure Cosmos DB service.

public interface IDocumentQuery<T> : IDocumentQuery, IDisposable

Type Parameters

T

Source Query Type

Inherited Members
Extension Methods

Properties

HasMoreResults

Gets a value indicating whether there are potentially additional results that can be returned from the query in the Azure Cosmos DB service.

bool HasMoreResults { get; }

Property Value

bool

Boolean value representing if there are potentially additional results that can be returned from the query.

Remarks

Initially returns true. This value is set based on whether the last execution returned a continuation token.

Methods

ExecuteNextAsync(CancellationToken)

Executes the query and retrieves the next page of results as dynamic objects in the Azure Cosmos DB service.

Task<FeedResponse<dynamic>> ExecuteNextAsync(CancellationToken token = default)

Parameters

token CancellationToken

(Optional) The CancellationToken allows for notification that operations should be cancelled.

Returns

Task<FeedResponse<dynamic>>

The Task object for the asynchronous response from query execution.

ExecuteNextAsync<TResult>(CancellationToken)

Executes the query and retrieves the next page of results in the Azure Cosmos DB service.

Task<FeedResponse<TResult>> ExecuteNextAsync<TResult>(CancellationToken token = default)

Parameters

token CancellationToken

(Optional) The CancellationToken allows for notification that operations should be cancelled.

Returns

Task<FeedResponse<TResult>>

The Task object for the asynchronous response from query execution.

Type Parameters

TResult

The type of the object returned in the query result.