ParallelEnumerable.Distinct 方法

定义

通过使用默认的相等比较器对值进行比较,返回并行序列中的非重复元素。Returns distinct elements from a parallel sequence by using the default equality comparer to compare values.

重载

Distinct<TSource>(ParallelQuery<TSource>)

通过使用默认的相等比较器对值进行比较,返回并行序列中的非重复元素。Returns distinct elements from a parallel sequence by using the default equality comparer to compare values.

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

通过使用指定的 IEqualityComparer<T> 对值进行比较,返回并行序列中的非重复元素。Returns distinct elements from a parallel sequence by using a specified IEqualityComparer<T> to compare values.

Distinct<TSource>(ParallelQuery<TSource>)

通过使用默认的相等比较器对值进行比较,返回并行序列中的非重复元素。Returns distinct elements from a parallel sequence by using the default equality comparer to compare values.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TSource> ^ Distinct(System::Linq::ParallelQuery<TSource> ^ source);
public static System.Linq.ParallelQuery<TSource> Distinct<TSource> (this System.Linq.ParallelQuery<TSource> source);
static member Distinct : System.Linq.ParallelQuery<'Source> -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function Distinct(Of TSource) (source As ParallelQuery(Of TSource)) As ParallelQuery(Of TSource)

类型参数

TSource

source 的元素类型。The type of the elements of source.

参数

source
ParallelQuery<TSource>

要从中移除重复元素的序列。The sequence to remove duplicate elements from.

返回

ParallelQuery<TSource>

一个序列,其中包含源序列中的非重复元素。A sequence that contains distinct elements from the source sequence.

例外

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

另请参阅

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

通过使用指定的 IEqualityComparer<T> 对值进行比较,返回并行序列中的非重复元素。Returns distinct elements from a parallel sequence by using a specified IEqualityComparer<T> to compare values.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TSource> ^ Distinct(System::Linq::ParallelQuery<TSource> ^ source, System::Collections::Generic::IEqualityComparer<TSource> ^ comparer);
public static System.Linq.ParallelQuery<TSource> Distinct<TSource> (this System.Linq.ParallelQuery<TSource> source, System.Collections.Generic.IEqualityComparer<TSource> comparer);
public static System.Linq.ParallelQuery<TSource> Distinct<TSource> (this System.Linq.ParallelQuery<TSource> source, System.Collections.Generic.IEqualityComparer<TSource>? comparer);
static member Distinct : System.Linq.ParallelQuery<'Source> * System.Collections.Generic.IEqualityComparer<'Source> -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function Distinct(Of TSource) (source As ParallelQuery(Of TSource), comparer As IEqualityComparer(Of TSource)) As ParallelQuery(Of TSource)

类型参数

TSource

source 的元素类型。The type of the elements of source.

参数

source
ParallelQuery<TSource>

要从中移除重复元素的序列。The sequence to remove duplicate elements from.

comparer
IEqualityComparer<TSource>

用于比较值的 IEqualityComparer<T>An IEqualityComparer<T> to compare values.

返回

ParallelQuery<TSource>

一个序列,其中包含源序列中的非重复元素。A sequence that contains distinct elements from the source sequence.

例外

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

另请参阅

适用于