Share via


DbRawSqlQuery<TElement>.ContainsAsync Method

Definition

Overloads

ContainsAsync(TElement)

Asynchronously determines whether the query contains a specified element by using the default equality comparer.

ContainsAsync(TElement, CancellationToken)

Asynchronously determines whether the query contains a specified element by using the default equality comparer.

ContainsAsync(TElement)

Asynchronously determines whether the query contains a specified element by using the default equality comparer.

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

Parameters

value
TElement

The object to locate in the query result.

Returns

A task that represents the asynchronous operation. The task result contains true if the query result contains the specified value; 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

ContainsAsync(TElement, CancellationToken)

Asynchronously determines whether the query contains a specified element by using the default equality comparer.

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

Parameters

value
TElement

The object to locate in the query result.

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 the specified value; 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