ImmutableArrayExtensions::ToDictionary<TKey, T> Method (ImmutableArray<T>, Func<T, TKey>^, IEqualityComparer<TKey>^)

 

Creates a dictionary based on the contents of this array.

Namespace:   System.Linq
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public:
generic<typename TKey, typename T>
[ExtensionAttribute]
static Dictionary<TKey, T>^ ToDictionary(
	ImmutableArray<T> immutableArray,
	Func<T, TKey>^ keySelector,
	IEqualityComparer<TKey>^ comparer
)

Parameters

immutableArray
Type: System.Collections.Immutable::ImmutableArray<T>

The array to create a dictionary from.

keySelector
Type: System::Func<T, TKey>^

The key selector.

comparer
Type: System.Collections.Generic::IEqualityComparer<TKey>^

The comparer to initialize the dictionary with.

Return Value

Type: System.Collections.Generic::Dictionary<TKey, T>^

The newly initialized dictionary.

Type Parameters

TKey

The type of the key.

T

The type of element contained by the collection.

Return to top
Show: