你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CosmosLinqExtensions.CountAsync<TSource> 方法

定义

返回序列中的元素数量。

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<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<Microsoft.Azure.Cosmos.Response<int>>
<Extension()>
Public Function CountAsync(Of TSource) (source As IQueryable(Of TSource), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Integer))

类型参数

TSource

源的元素的类型。

参数

source
IQueryable<TSource>

包含要计数的元素的序列。

cancellationToken
CancellationToken

取消标记。

返回

输入序列中的元素数量。

适用于