Enumerable.ExceptBy 方法

定义

重载

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>)

根据指定的键选择器函数生成两个序列的集差。

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根据指定的键选择器函数生成两个序列的集差。

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>)

Source:
Except.cs
Source:
Except.cs
Source:
Except.cs

根据指定的键选择器函数生成两个序列的集差。

public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<TSource> ^ ExceptBy(System::Collections::Generic::IEnumerable<TSource> ^ first, System::Collections::Generic::IEnumerable<TKey> ^ second, Func<TSource, TKey> ^ keySelector);
public static System.Collections.Generic.IEnumerable<TSource> ExceptBy<TSource,TKey> (this System.Collections.Generic.IEnumerable<TSource> first, System.Collections.Generic.IEnumerable<TKey> second, Func<TSource,TKey> keySelector);
static member ExceptBy : seq<'Source> * seq<'Key> * Func<'Source, 'Key> -> seq<'Source>
<Extension()>
Public Function ExceptBy(Of TSource, TKey) (first As IEnumerable(Of TSource), second As IEnumerable(Of TKey), keySelector As Func(Of TSource, TKey)) As IEnumerable(Of TSource)

类型参数

TSource

输入序列的元素的类型。

TKey

要标识元素的键的类型。

参数

first
IEnumerable<TSource>

IEnumerable<T> 返回不 second 位于 中的键的 。

second
IEnumerable<TKey>

一个 , IEnumerable<T> 其键也出现在第一个序列中,将导致从返回的序列中删除这些元素。

keySelector
Func<TSource,TKey>

用于提取每个元素的键的函数。

返回

IEnumerable<TSource>

包含这两个序列的元素的差集的序列。

另请参阅

适用于

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Source:
Except.cs
Source:
Except.cs
Source:
Except.cs

根据指定的键选择器函数生成两个序列的集差。

public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<TSource> ^ ExceptBy(System::Collections::Generic::IEnumerable<TSource> ^ first, System::Collections::Generic::IEnumerable<TKey> ^ second, Func<TSource, TKey> ^ keySelector, System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public static System.Collections.Generic.IEnumerable<TSource> ExceptBy<TSource,TKey> (this System.Collections.Generic.IEnumerable<TSource> first, System.Collections.Generic.IEnumerable<TKey> second, Func<TSource,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer);
static member ExceptBy : seq<'Source> * seq<'Key> * Func<'Source, 'Key> * System.Collections.Generic.IEqualityComparer<'Key> -> seq<'Source>
<Extension()>
Public Function ExceptBy(Of TSource, TKey) (first As IEnumerable(Of TSource), second As IEnumerable(Of TKey), keySelector As Func(Of TSource, TKey), comparer As IEqualityComparer(Of TKey)) As IEnumerable(Of TSource)

类型参数

TSource

输入序列的元素的类型。

TKey

要标识元素的键的类型。

参数

first
IEnumerable<TSource>

IEnumerable<T> 返回不 second 位于 中的键的 。

second
IEnumerable<TKey>

一个 , IEnumerable<T> 其键也出现在第一个序列中,将导致从返回的序列中删除这些元素。

keySelector
Func<TSource,TKey>

用于提取每个元素的键的函数。

comparer
IEqualityComparer<TKey>

用于比较值的 IEqualityComparer<T>

返回

IEnumerable<TSource>

包含这两个序列的元素的差集的序列。

另请参阅

适用于