DocumentQueryable.CountAsync<TSource> Method

Definition

Returns the number of elements in a sequence.

public static System.Threading.Tasks.Task<int> CountAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Threading.CancellationToken cancellationToken = default);
static member CountAsync : System.Linq.IQueryable<'Source> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
<Extension()>
Public Function CountAsync(Of TSource) (source As IQueryable(Of TSource), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Integer)

Type Parameters

TSource

The type of the elements of source.

Parameters

source
IQueryable<TSource>

The sequence that contains the elements to be counted.

cancellationToken
CancellationToken

The cancellation token.

Returns

The number of elements in the input sequence.

Applies to