ParallelEnumerable.ToLookup Method

Definition

Overloads

ToLookup<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Creates an ILookup<TKey,TElement> from a ParallelQuery<TSource> according to a specified key selector function, a comparer and an element selector function.

C#
public static System.Linq.ILookup<TKey,TElement> ToLookup<TSource,TKey,TElement>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector, System.Collections.Generic.IEqualityComparer<TKey> comparer);
C#
public static System.Linq.ILookup<TKey,TElement> ToLookup<TSource,TKey,TElement>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer);

Type Parameters

TSource

The type of elements of source.

TKey

The type of the key returned by keySelector.

TElement

The type of the value returned by elementSelector.

Parameters

source
ParallelQuery<TSource>

The sequence to create a ILookup<TKey,TElement> from.

keySelector
Func<TSource,TKey>

A function to extract a key from each element.

elementSelector
Func<TSource,TElement>

A transform function to produce a result element value from each element.

comparer
IEqualityComparer<TKey>

An IEqualityComparer<T> to compare keys.

Returns

A Lookup<(Of <(TKey, TElement>)>) that contains values of type TElement selected from the input sequence.

Exceptions

source or keySelector or elementSelector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

ToLookup<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Creates an ILookup<TKey,TElement> from a ParallelQuery<TSource> according to specified key selector and element selector functions.

C#
public static System.Linq.ILookup<TKey,TElement> ToLookup<TSource,TKey,TElement>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector);

Type Parameters

TSource

The type of elements of source.

TKey

The type of the key returned by keySelector.

TElement

The type of the value returned by elementSelector.

Parameters

source
ParallelQuery<TSource>

The sequence to create a ILookup<TKey,TElement> from.

keySelector
Func<TSource,TKey>

A function to extract a key from each element.

elementSelector
Func<TSource,TElement>

A transform function to produce a result element value from each element.

Returns

A ILookup<TKey,TElement> that contains values of type TElement selected from the input sequence.

Exceptions

source or keySelector or elementSelector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

ToLookup<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Creates an ILookup<TKey,TElement> from a ParallelQuery<TSource> according to a specified key selector function and key comparer.

C#
public static System.Linq.ILookup<TKey,TSource> ToLookup<TSource,TKey>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey> comparer);
C#
public static System.Linq.ILookup<TKey,TSource> ToLookup<TSource,TKey>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer);

Type Parameters

TSource

The type of elements of source.

TKey

The type of the key returned by keySelector.

Parameters

source
ParallelQuery<TSource>

The sequence to create a ILookup<TKey,TElement> from.

keySelector
Func<TSource,TKey>

A function to extract a key from each element.

comparer
IEqualityComparer<TKey>

An IEqualityComparer<T> to compare keys.

Returns

ILookup<TKey,TSource>

A ILookup<TKey,TElement> that contains keys and values.

Exceptions

source or keySelector or is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

ToLookup<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Creates an ILookup<TKey,TElement> from a ParallelQuery<TSource> according to a specified key selector function.

C#
public static System.Linq.ILookup<TKey,TSource> ToLookup<TSource,TKey>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector);

Type Parameters

TSource

The type of elements of source.

TKey

The type of the key returned by keySelector.

Parameters

source
ParallelQuery<TSource>

The sequence to create a ILookup<TKey,TElement> from.

keySelector
Func<TSource,TKey>

A function to extract a key from each element.

Returns

ILookup<TKey,TSource>

A ILookup<TKey,TElement> that contains keys and values.

Exceptions

source or keySelector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0