ParallelEnumerable.Contains ParallelEnumerable.Contains ParallelEnumerable.Contains Method

Definition

Determines in parallel whether a sequence contains a specified element.

Overloads

Contains<TSource>(ParallelQuery<TSource>, TSource, IEqualityComparer<TSource>) Contains<TSource>(ParallelQuery<TSource>, TSource, IEqualityComparer<TSource>) Contains<TSource>(ParallelQuery<TSource>, TSource, IEqualityComparer<TSource>)

Determines in parallel whether a sequence contains a specified element by using a specified IEqualityComparer<T>.

Contains<TSource>(ParallelQuery<TSource>, TSource) Contains<TSource>(ParallelQuery<TSource>, TSource) Contains<TSource>(ParallelQuery<TSource>, TSource)

Determines in parallel whether a sequence contains a specified element by using the default equality comparer.

Contains<TSource>(ParallelQuery<TSource>, TSource, IEqualityComparer<TSource>) Contains<TSource>(ParallelQuery<TSource>, TSource, IEqualityComparer<TSource>) Contains<TSource>(ParallelQuery<TSource>, TSource, IEqualityComparer<TSource>)

Determines in parallel whether a sequence contains a specified element by using a specified IEqualityComparer<T>.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static bool Contains(System::Linq::ParallelQuery<TSource> ^ source, TSource value, System::Collections::Generic::IEqualityComparer<TSource> ^ comparer);
public static bool Contains<TSource> (this System.Linq.ParallelQuery<TSource> source, TSource value, System.Collections.Generic.IEqualityComparer<TSource> comparer);
<Extension()>
Public Function Contains(Of TSource) (source As ParallelQuery(Of TSource), value As TSource, comparer As IEqualityComparer(Of TSource)) As Boolean
Type Parameters
TSource

The type of elements of source.

Parameters
source
ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource>

A sequence in which to locate a value.

value

The value to locate in the sequence.

comparer
IEqualityComparer<TSource>

An equality comparer to compare values.

Returns

true if the source sequence contains an element that has the specified value; otherwise, false.

Exceptions

The query was canceled with the token passed in through WithCancellation.

source is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

Contains<TSource>(ParallelQuery<TSource>, TSource) Contains<TSource>(ParallelQuery<TSource>, TSource) Contains<TSource>(ParallelQuery<TSource>, TSource)

Determines in parallel whether a sequence contains a specified element by using the default equality comparer.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static bool Contains(System::Linq::ParallelQuery<TSource> ^ source, TSource value);
public static bool Contains<TSource> (this System.Linq.ParallelQuery<TSource> source, TSource value);
<Extension()>
Public Function Contains(Of TSource) (source As ParallelQuery(Of TSource), value As TSource) As Boolean
Type Parameters
TSource

The type of elements of source.

Parameters
source
ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource>

A sequence in which to locate a value.

value

The value to locate in the sequence.

Returns

true if the source sequence contains an element that has the specified value; otherwise, false.

Exceptions

The query was canceled with the token passed in through WithCancellation.

source is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

Applies to