Redigera

Dela via


IDocumentReader<TDocument>.FetchDocumentsAsync<TOutputDocument> Method

Definition

Fetches a collection of documents.

public:
generic <typename TOutputDocument>
 System::Threading::Tasks::Task<System::Cloud::DocumentDb::IDatabaseResponse<System::Collections::Generic::IReadOnlyList<TOutputDocument> ^> ^> ^ FetchDocumentsAsync(System::Cloud::DocumentDb::QueryRequestOptions<TDocument> ^ options, Func<System::Linq::IQueryable<TDocument> ^, System::Linq::IQueryable<TOutputDocument> ^> ^ condition, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<System.Collections.Generic.IReadOnlyList<TOutputDocument>>> FetchDocumentsAsync<TOutputDocument>(System.Cloud.DocumentDb.QueryRequestOptions<TDocument> options, Func<System.Linq.IQueryable<TDocument>,System.Linq.IQueryable<TOutputDocument>>? condition, System.Threading.CancellationToken cancellationToken);
abstract member FetchDocumentsAsync : System.Cloud.DocumentDb.QueryRequestOptions<'Document> * Func<System.Linq.IQueryable<'Document>, System.Linq.IQueryable<'OutputDocument>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<System.Collections.Generic.IReadOnlyList<'OutputDocument>>>
Public Function FetchDocumentsAsync(Of TOutputDocument) (options As QueryRequestOptions(Of TDocument), condition As Func(Of IQueryable(Of TDocument), IQueryable(Of TOutputDocument)), cancellationToken As CancellationToken) As Task(Of IDatabaseResponse(Of IReadOnlyList(Of TOutputDocument)))

Type Parameters

TOutputDocument

The type used to map results from TDocument after condition is applied.

Parameters

options
QueryRequestOptions<TDocument>

The request options.

condition
Func<IQueryable<TDocument>,IQueryable<TOutputDocument>>

The fetch condition function.

cancellationToken
CancellationToken

The token represents request cancellation.

Returns

Task<IDatabaseResponse<IReadOnlyList<TOutputDocument>>>

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