Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

QueryableExtensions::ContainsAsync Method

Entity Framework 6.0
 

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

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

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticContainsAsync<TSource>(IQueryable<TSource>^, TSource)

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

System_CAPS_pubmethodSystem_CAPS_staticContainsAsync<TSource>(IQueryable<TSource>^, TSource, CancellationToken)

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

Return to top

QueryableExtensions::ContainsAsync<TSource> Method (IQueryable<TSource>^, TSource)

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

public:
generic<typename TSource>
[ExtensionAttribute]
static Task<bool>^ ContainsAsync(
	IQueryable<TSource>^ source,
	TSource item
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to return the single element of.

item
Type: TSource

The object to locate in the sequence.

Return Value

Type: System.Threading.Tasks::Task<Boolean>^

A task that represents the asynchronous operation. The task result contains true if the input sequence contains the specified value; otherwise, false.

Type Parameters

TSource

The type of the elements of source.

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::ContainsAsync<TSource> Method (IQueryable<TSource>^, TSource, CancellationToken)

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

public:
generic<typename TSource>
[ExtensionAttribute]
static Task<bool>^ ContainsAsync(
	IQueryable<TSource>^ source,
	TSource item,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to return the single element of.

item
Type: TSource

The object to locate in the sequence.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Boolean>^

A task that represents the asynchronous operation. The task result contains true if the input sequence contains the specified value; otherwise, false.

Type Parameters

TSource

The type of the elements of source.

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top
Show: