Share via


DbRawSqlQuery<TElement>.LongCountAsync Method

Definition

Overloads

LongCountAsync(CancellationToken)

Asynchronously returns an Int64 that represents the total number of elements in the query.

LongCountAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously returns an Int64 that represents the number of elements in the query that satisfy a condition.

LongCountAsync()

Asynchronously returns an Int64 that represents the total number of elements in the query.

LongCountAsync(Func<TElement,Boolean>)

Asynchronously returns an Int64 that represents the number of elements in the query that satisfy a condition.

LongCountAsync(CancellationToken)

Asynchronously returns an Int64 that represents the total number of elements in the query.

public System.Threading.Tasks.Task<long> LongCountAsync (System.Threading.CancellationToken cancellationToken);
member this.LongCountAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<int64>

Parameters

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the number of elements in the query result.

Exceptions

The number of elements in the query result is larger than MaxValue .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

LongCountAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously returns an Int64 that represents the number of elements in the query that satisfy a condition.

public System.Threading.Tasks.Task<long> LongCountAsync (Func<TElement,bool> predicate, System.Threading.CancellationToken cancellationToken);
member this.LongCountAsync : Func<'Element, bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int64>

Parameters

predicate
Func<TElement,Boolean>

A function to test each element for a condition.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the number of elements in the query result that satisfy the condition in the predicate function.

Exceptions

The number of elements in the query result that satisfy the condition in the predicate function is larger than MaxValue .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

LongCountAsync()

Asynchronously returns an Int64 that represents the total number of elements in the query.

public System.Threading.Tasks.Task<long> LongCountAsync ();
member this.LongCountAsync : unit -> System.Threading.Tasks.Task<int64>
Public Function LongCountAsync () As Task(Of Long)

Returns

A task that represents the asynchronous operation. The task result contains the number of elements in the query result.

Exceptions

The number of elements in the query result is larger than MaxValue .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

LongCountAsync(Func<TElement,Boolean>)

Asynchronously returns an Int64 that represents the number of elements in the query that satisfy a condition.

public System.Threading.Tasks.Task<long> LongCountAsync (Func<TElement,bool> predicate);
member this.LongCountAsync : Func<'Element, bool> -> System.Threading.Tasks.Task<int64>
Public Function LongCountAsync (predicate As Func(Of TElement, Boolean)) As Task(Of Long)

Parameters

predicate
Func<TElement,Boolean>

A function to test each element for a condition.

Returns

A task that represents the asynchronous operation. The task result contains the number of elements in the query result that satisfy the condition in the predicate function.

Exceptions

The number of elements in the query result that satisfy the condition in the predicate function is larger than MaxValue .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to