DbRawSqlQuery<TElement>.LongCountAsync Method

 

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

Namespace:   System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodLongCountAsync()

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

System_CAPS_pubmethodLongCountAsync(CancellationToken)

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

System_CAPS_pubmethodLongCountAsync(Func<TElement, Boolean>)

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

System_CAPS_pubmethodLongCountAsync(Func<TElement, Boolean>, CancellationToken)

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


DbRawSqlQuery<TElement>.LongCountAsync Method ()

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

public Task<long> LongCountAsync()

Return Value

Type: System.Threading.Tasks.Task<Int64>

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

Exception Condition
OverflowException

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

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.


DbRawSqlQuery<TElement>.LongCountAsync Method (CancellationToken)

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

public Task<long> LongCountAsync(
	CancellationToken cancellationToken
)

Parameters

cancellationToken
Type: System.Threading.CancellationToken

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

Return Value

Type: System.Threading.Tasks.Task<Int64>

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

Exception Condition
OverflowException

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

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.


DbRawSqlQuery<TElement>.LongCountAsync Method (Func<TElement, Boolean>)

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

public Task<long> LongCountAsync(
	Func<TElement, bool> predicate
)

Parameters

predicate
Type: System.Func<TElement, Boolean>

A function to test each element for a condition.

Return Value

Type: System.Threading.Tasks.Task<Int64>

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.

Exception Condition
OverflowException

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

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.


DbRawSqlQuery<TElement>.LongCountAsync Method (Func<TElement, Boolean>, CancellationToken)

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

public Task<long> LongCountAsync(
	Func<TElement, bool> predicate,
	CancellationToken cancellationToken
)

Parameters

predicate
Type: System.Func<TElement, Boolean>

A function to test each element for a condition.

cancellationToken
Type: System.Threading.CancellationToken

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

Return Value

Type: System.Threading.Tasks.Task<Int64>

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.

Exception Condition
OverflowException

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

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.