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>)

根據指定的索引鍵選取器函式,產生兩個序列的集合差異。

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>)

根據指定的索引鍵選取器函式,產生兩個序列的集合差異。

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>

序列,其中包含兩個序列之項目的差異。

另請參閱

適用於