Enumerable.ExceptBy Method (System.Linq) (original) (raw)

Definition

Namespace:

System.Linq

Assemblies:

netstandard.dll, System.Linq.dll

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.

Overloads

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

Source:

Except.cs

Source:

Except.cs

Source:

Except.cs

Produces the set difference of two sequences according to a specified key selector function.

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)

Type Parameters

TSource

The type of the elements of the input sequence.

TKey

The type of key to identify elements by.

Parameters

second

IEnumerable

An IEnumerable whose keys that also occur in the first sequence will cause those elements to be removed from the returned sequence.

keySelector

Func<TSource,TKey>

A function to extract the key for each element.

Returns

A sequence that contains the set difference of the elements of two sequences.

See also

Applies to

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

Source:

Except.cs

Source:

Except.cs

Source:

Except.cs

Produces the set difference of two sequences according to a specified key selector function.

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)

Type Parameters

TSource

The type of the elements of the input sequence.

TKey

The type of key to identify elements by.

Parameters

second

IEnumerable

An IEnumerable whose keys that also occur in the first sequence will cause those elements to be removed from the returned sequence.

keySelector

Func<TSource,TKey>

A function to extract the key for each element.

Returns

A sequence that contains the set difference of the elements of two sequences.

See also

Applies to