DbRawSqlQuery<TElement>::LongCountAsync Method
Asynchronously returns an Int64 that represents the total number of elements in the query.
Assembly: EntityFramework (in EntityFramework.dll)
| Name | Description | |
|---|---|---|
![]() | LongCountAsync() | Asynchronously returns an Int64 that represents the total number of elements in the query. |
![]() | LongCountAsync(CancellationToken) | 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(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.
| 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.
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.
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 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.
