ParallelEnumerable.Contains Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines in parallel whether a sequence contains a specified element.
Overloads
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) |
Determines in parallel whether a sequence contains a specified element by using the default equality comparer. |
Contains<TSource>(ParallelQuery<TSource>, TSource, IEqualityComparer<TSource>)
- Source:
- ParallelEnumerable.cs
- Source:
- ParallelEnumerable.cs
- Source:
- ParallelEnumerable.cs
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);
public static bool Contains<TSource> (this System.Linq.ParallelQuery<TSource> source, TSource value, System.Collections.Generic.IEqualityComparer<TSource>? comparer);
static member Contains : System.Linq.ParallelQuery<'Source> * 'Source * System.Collections.Generic.IEqualityComparer<'Source> -> bool
<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>
A sequence in which to locate a value.
- value
- TSource
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<TSource>(ParallelQuery<TSource>, CancellationToken).
source
is a null reference (Nothing in Visual Basic).
One or more exceptions occurred during the evaluation of the query.
See also
Applies to
Contains<TSource>(ParallelQuery<TSource>, TSource)
- Source:
- ParallelEnumerable.cs
- Source:
- ParallelEnumerable.cs
- Source:
- ParallelEnumerable.cs
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);
static member Contains : System.Linq.ParallelQuery<'Source> * 'Source -> bool
<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>
A sequence in which to locate a value.
- value
- TSource
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<TSource>(ParallelQuery<TSource>, CancellationToken).
source
is a null reference (Nothing in Visual Basic).
One or more exceptions occurred during the evaluation of the query.