DocumentQueryable.CountAsync 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 = null);
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.