Share via


DbRawSqlQuery<TElement>.AnyAsync Method

Definition

Overloads

AnyAsync()

Asynchronously determines whether the query contains any elements.

AnyAsync(Func<TElement,Boolean>)

Asynchronously determines whether any element of the query satisfies a condition.

AnyAsync(CancellationToken)

Asynchronously determines whether the query contains any elements.

AnyAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously determines whether any element of the query satisfies a condition.

AnyAsync()

Asynchronously determines whether the query contains any elements.

public System.Threading.Tasks.Task<bool> AnyAsync ();
member this.AnyAsync : unit -> System.Threading.Tasks.Task<bool>
Public Function AnyAsync () As Task(Of Boolean)

Returns

A task that represents the asynchronous operation. The task result contains true if the query result contains any elements; otherwise, false.

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

AnyAsync(Func<TElement,Boolean>)

Asynchronously determines whether any element of the query satisfies a condition.

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

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 true if any elements in the query result pass the test in the specified predicate; otherwise, false.

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

AnyAsync(CancellationToken)

Asynchronously determines whether the query contains any elements.

public System.Threading.Tasks.Task<bool> AnyAsync (System.Threading.CancellationToken cancellationToken);
member this.AnyAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>

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 true if the query result contains any elements; otherwise, false.

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

AnyAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously determines whether any element of the query satisfies a condition.

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

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 true if any elements in the query result pass the test in the specified predicate; otherwise, false.

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