IDocumentReader<TDocument>.QueryDocumentsAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Fetches a collection of documents using a custom query provided.
public:
System::Threading::Tasks::Task<System::Cloud::DocumentDb::IDatabaseResponse<System::Collections::Generic::IReadOnlyList<TDocument> ^> ^> ^ QueryDocumentsAsync(System::Cloud::DocumentDb::QueryRequestOptions<TDocument> ^ options, System::Cloud::DocumentDb::Query query, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<System.Collections.Generic.IReadOnlyList<TDocument>>> QueryDocumentsAsync(System.Cloud.DocumentDb.QueryRequestOptions<TDocument> options, System.Cloud.DocumentDb.Query query, System.Threading.CancellationToken cancellationToken);
abstract member QueryDocumentsAsync : System.Cloud.DocumentDb.QueryRequestOptions<'Document> * System.Cloud.DocumentDb.Query * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<System.Collections.Generic.IReadOnlyList<'Document>>>
Public Function QueryDocumentsAsync (options As QueryRequestOptions(Of TDocument), query As Query, cancellationToken As CancellationToken) As Task(Of IDatabaseResponse(Of IReadOnlyList(Of TDocument)))
Parameters
- options
- QueryRequestOptions<TDocument>
The query request options.
- query
- Query
The query to fetch items.
- cancellationToken
- CancellationToken
The token represents request cancellation.
Returns
A Task containing a IDatabaseResponse<T> that wraps enumerable of fetched documents.
Exceptions
Thrown when an error occurred on a client side. For example on a bad request, permissions error or client timeout.
Thrown when an error occurred on a database server side, including internal server error.
Thrown when a request failed but can be retried. This includes throttling and server not available cases.
A generic exception thrown in all other not covered above cases.
Applies to
.NET