ParallelEnumerable.SequenceEqual 方法

定义

通过使用相应类型的相等比较器对序列的元素进行比较,以确定两个并行序列是否相等。Determines whether two parallel sequences are equal by comparing the elements by using an equality comparer for their type.

重载

SequenceEqual<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>)
已过时。

切勿调用此 SequenceEqual 重载。This SequenceEqual overload should never be called. 此方法已标记为过时,调用此方法时总是会引发 NotSupportedExceptionThis method is marked as obsolete and always throws NotSupportedException when called.

SequenceEqual<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>)

通过使用相应类型的默认相等比较器对序列的元素进行比较,以确定两个并行序列是否相等。Determines whether two parallel sequences are equal by comparing the elements by using the default equality comparer for their type.

SequenceEqual<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)
已过时。

切勿调用此 SequenceEqual 重载。This SequenceEqual overload should never be called. 此方法已标记为过时,调用此方法时总是会引发 NotSupportedExceptionThis method is marked as obsolete and always throws NotSupportedException when called.

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

使用指定的 IEqualityComparer{T} 对两个并行序列的元素进行比较,以确定这两个序列是否相等。Determines whether two parallel sequences are equal by comparing their elements by using a specified IEqualityComparer{T}.

SequenceEqual<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>)

注意

The second data source of a binary operator must be of type System.Linq.ParallelQuery rather than System.Collections.Generic.IEnumerable. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery.

切勿调用此 SequenceEqual 重载。This SequenceEqual overload should never be called. 此方法已标记为过时,调用此方法时总是会引发 NotSupportedExceptionThis method is marked as obsolete and always throws NotSupportedException when called.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static bool SequenceEqual(System::Linq::ParallelQuery<TSource> ^ first, System::Collections::Generic::IEnumerable<TSource> ^ second);
public static bool SequenceEqual<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Collections.Generic.IEnumerable<TSource> second);
[System.Obsolete("The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
public static bool SequenceEqual<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Collections.Generic.IEnumerable<TSource> second);
static member SequenceEqual : System.Linq.ParallelQuery<'Source> * seq<'Source> -> bool
[<System.Obsolete("The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")>]
static member SequenceEqual : System.Linq.ParallelQuery<'Source> * seq<'Source> -> bool
<Extension()>
Public Function SequenceEqual(Of TSource) (first As ParallelQuery(Of TSource), second As IEnumerable(Of TSource)) As Boolean

类型参数

TSource

未使用此类型参数。This type parameter is not used.

参数

first
ParallelQuery<TSource>

未使用此参数。This parameter is not used.

second
IEnumerable<TSource>

未使用此参数。This parameter is not used.

返回

Boolean

此重载总是会引发 NotSupportedExceptionThis overload always throws a NotSupportedException.

属性

例外

每次调用此方法时引发。Thrown every time this method is called.

注解

此重载存在于不允许使用具有类型的左侧数据源的 SequenceEqual ParallelQuery<TSource> 和类型为的右侧数据源 IEnumerable<T>This overload exists to disallow usage of SequenceEqual with a left data source of type ParallelQuery<TSource> and a right data source of type IEnumerable<T>. 否则,SequenceEqual 运算符似乎绑定到并行实现,但实际上绑定到了顺序实现。Otherwise, the SequenceEqual operator would appear to be binding to the parallel implementation, but would in reality bind to the sequential implementation.

另请参阅

适用于

SequenceEqual<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>)

通过使用相应类型的默认相等比较器对序列的元素进行比较,以确定两个并行序列是否相等。Determines whether two parallel sequences are equal by comparing the elements by using the default equality comparer for their type.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static bool SequenceEqual(System::Linq::ParallelQuery<TSource> ^ first, System::Linq::ParallelQuery<TSource> ^ second);
public static bool SequenceEqual<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Linq.ParallelQuery<TSource> second);
static member SequenceEqual : System.Linq.ParallelQuery<'Source> * System.Linq.ParallelQuery<'Source> -> bool
<Extension()>
Public Function SequenceEqual(Of TSource) (first As ParallelQuery(Of TSource), second As ParallelQuery(Of TSource)) As Boolean

类型参数

TSource

输入序列中的元素的类型。The type of the elements of the input sequences.

参数

first
ParallelQuery<TSource>

要与第二个序列进行比较的序列。A sequence to compare to second.

second
ParallelQuery<TSource>

要与第一个输入序列进行比较的序列。A sequence to compare to the first input sequence.

返回

Boolean

如果根据相应类型的默认相等比较器,两个源序列的长度相等,且其相应元素相等,则为 true;否则为 falsetrue if the two source sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type; otherwise, false.

例外

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

firstsecond 为 null 引用(在 Visual Basic 中为 Nothing)。first or second is a null reference (Nothing in Visual Basic).

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

另请参阅

适用于

SequenceEqual<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

注意

The second data source of a binary operator must be of type System.Linq.ParallelQuery rather than System.Collections.Generic.IEnumerable. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery.

切勿调用此 SequenceEqual 重载。This SequenceEqual overload should never be called. 此方法已标记为过时,调用此方法时总是会引发 NotSupportedExceptionThis method is marked as obsolete and always throws NotSupportedException when called.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static bool SequenceEqual(System::Linq::ParallelQuery<TSource> ^ first, System::Collections::Generic::IEnumerable<TSource> ^ second, System::Collections::Generic::IEqualityComparer<TSource> ^ comparer);
public static bool SequenceEqual<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Collections.Generic.IEnumerable<TSource> second, System.Collections.Generic.IEqualityComparer<TSource> comparer);
[System.Obsolete("The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
public static bool SequenceEqual<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Collections.Generic.IEnumerable<TSource> second, System.Collections.Generic.IEqualityComparer<TSource>? comparer);
[System.Obsolete("The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
public static bool SequenceEqual<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Collections.Generic.IEnumerable<TSource> second, System.Collections.Generic.IEqualityComparer<TSource> comparer);
static member SequenceEqual : System.Linq.ParallelQuery<'Source> * seq<'Source> * System.Collections.Generic.IEqualityComparer<'Source> -> bool
[<System.Obsolete("The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")>]
static member SequenceEqual : System.Linq.ParallelQuery<'Source> * seq<'Source> * System.Collections.Generic.IEqualityComparer<'Source> -> bool
<Extension()>
Public Function SequenceEqual(Of TSource) (first As ParallelQuery(Of TSource), second As IEnumerable(Of TSource), comparer As IEqualityComparer(Of TSource)) As Boolean

类型参数

TSource

未使用此类型参数。This type parameter is not used.

参数

first
ParallelQuery<TSource>

未使用此参数。This parameter is not used.

second
IEnumerable<TSource>

未使用此参数。This parameter is not used.

comparer
IEqualityComparer<TSource>

未使用此参数。This parameter is not used.

返回

Boolean

此重载总是会引发 NotSupportedExceptionThis overload always throws a NotSupportedException.

属性

例外

每次调用此方法时引发。Thrown every time this method is called.

注解

此重载存在于不允许使用具有类型的左侧数据源的 SequenceEqual ParallelQuery<TSource> 和类型为的右侧数据源 IEnumerable<T>This overload exists to disallow usage of SequenceEqual with a left data source of type ParallelQuery<TSource> and a right data source of type IEnumerable<T>. 否则,SequenceEqual 运算符似乎绑定到并行实现,但实际上绑定到了顺序实现。Otherwise, the SequenceEqual operator would appear to be binding to the parallel implementation, but would in reality bind to sequential implementation.

另请参阅

适用于

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

使用指定的 IEqualityComparer{T} 对两个并行序列的元素进行比较,以确定这两个序列是否相等。Determines whether two parallel sequences are equal by comparing their elements by using a specified IEqualityComparer{T}.

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

类型参数

TSource

输入序列中的元素的类型。The type of the elements of the input sequences.

参数

first
ParallelQuery<TSource>

要与 second 进行比较的序列。A sequence to compare to second.

second
ParallelQuery<TSource>

要与第一个输入序列进行比较的序列。A sequence to compare to the first input sequence.

comparer
IEqualityComparer<TSource>

用于比较元素的 IEqualityComparer<T>An IEqualityComparer<T> to use to compare elements.

返回

Boolean

如果根据相应类型的默认相等比较器,两个源序列的长度相等,且其相应元素相等,则为 true;否则为 falsetrue if the two source sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type; otherwise, false.

例外

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

firstsecond 为 null 引用(在 Visual Basic 中为 Nothing)。first or second is a null reference (Nothing in Visual Basic).

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

另请参阅

适用于