ImmutableArrayExtensions.ToDictionary 方法

定义

重载

ToDictionary<TKey,T>(ImmutableArray<T>, Func<T,TKey>)

基于此数组的内容创建字典。

ToDictionary<TKey,T>(ImmutableArray<T>, Func<T,TKey>, IEqualityComparer<TKey>)

基于此数组的内容创建字典。

ToDictionary<TKey,TElement,T>(ImmutableArray<T>, Func<T,TKey>, Func<T,TElement>, IEqualityComparer<TKey>)

基于此数组的内容创建字典。

ToDictionary<TKey,TElement,T>(ImmutableArray<T>, Func<T,TKey>, Func<T,TElement>)

基于此数组的内容创建字典。

ToDictionary<TKey,T>(ImmutableArray<T>, Func<T,TKey>)

Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs

基于此数组的内容创建字典。

public:
generic <typename TKey, typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::Dictionary<TKey, T> ^ ToDictionary(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, TKey> ^ keySelector);
public static System.Collections.Generic.Dictionary<TKey,T> ToDictionary<TKey,T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,TKey> keySelector);
static member ToDictionary : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, 'Key> -> System.Collections.Generic.Dictionary<'Key, 'T>
<Extension()>
Public Function ToDictionary(Of TKey, T) (immutableArray As ImmutableArray(Of T), keySelector As Func(Of T, TKey)) As Dictionary(Of TKey, T)

类型参数

TKey

键的类型。

T

集合包含的元素的类型。

参数

immutableArray
ImmutableArray<T>

要从其创建字典的数组。

keySelector
Func<T,TKey>

键选择器。

返回

Dictionary<TKey,T>

新初始化的字典。

适用于

ToDictionary<TKey,T>(ImmutableArray<T>, Func<T,TKey>, IEqualityComparer<TKey>)

Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs

基于此数组的内容创建字典。

public:
generic <typename TKey, typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::Dictionary<TKey, T> ^ ToDictionary(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, TKey> ^ keySelector, System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public static System.Collections.Generic.Dictionary<TKey,T> ToDictionary<TKey,T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey> comparer);
public static System.Collections.Generic.Dictionary<TKey,T> ToDictionary<TKey,T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer);
static member ToDictionary : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, 'Key> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.Dictionary<'Key, 'T>
<Extension()>
Public Function ToDictionary(Of TKey, T) (immutableArray As ImmutableArray(Of T), keySelector As Func(Of T, TKey), comparer As IEqualityComparer(Of TKey)) As Dictionary(Of TKey, T)

类型参数

TKey

键的类型。

T

集合包含的元素的类型。

参数

immutableArray
ImmutableArray<T>

要从其创建字典的数组。

keySelector
Func<T,TKey>

键选择器。

comparer
IEqualityComparer<TKey>

用于初始化字典的比较器。

返回

Dictionary<TKey,T>

新初始化的字典。

适用于

ToDictionary<TKey,TElement,T>(ImmutableArray<T>, Func<T,TKey>, Func<T,TElement>, IEqualityComparer<TKey>)

Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs

基于此数组的内容创建字典。

public:
generic <typename TKey, typename TElement, typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::Dictionary<TKey, TElement> ^ ToDictionary(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, TKey> ^ keySelector, Func<T, TElement> ^ elementSelector, System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public static System.Collections.Generic.Dictionary<TKey,TElement> ToDictionary<TKey,TElement,T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,TKey> keySelector, Func<T,TElement> elementSelector, System.Collections.Generic.IEqualityComparer<TKey> comparer);
public static System.Collections.Generic.Dictionary<TKey,TElement> ToDictionary<TKey,TElement,T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,TKey> keySelector, Func<T,TElement> elementSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer);
static member ToDictionary : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, 'Key> * Func<'T, 'Element> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.Dictionary<'Key, 'Element>
<Extension()>
Public Function ToDictionary(Of TKey, TElement, T) (immutableArray As ImmutableArray(Of T), keySelector As Func(Of T, TKey), elementSelector As Func(Of T, TElement), comparer As IEqualityComparer(Of TKey)) As Dictionary(Of TKey, TElement)

类型参数

TKey

键的类型。

TElement

元素的类型。

T

集合包含的元素的类型。

参数

immutableArray
ImmutableArray<T>

要从其创建字典的数组。

keySelector
Func<T,TKey>

键选择器。

elementSelector
Func<T,TElement>

元素选择器。

comparer
IEqualityComparer<TKey>

用于初始化字典的比较器。

返回

Dictionary<TKey,TElement>

新初始化的字典。

适用于

ToDictionary<TKey,TElement,T>(ImmutableArray<T>, Func<T,TKey>, Func<T,TElement>)

Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs

基于此数组的内容创建字典。

public:
generic <typename TKey, typename TElement, typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::Dictionary<TKey, TElement> ^ ToDictionary(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, TKey> ^ keySelector, Func<T, TElement> ^ elementSelector);
public static System.Collections.Generic.Dictionary<TKey,TElement> ToDictionary<TKey,TElement,T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,TKey> keySelector, Func<T,TElement> elementSelector);
static member ToDictionary : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, 'Key> * Func<'T, 'Element> -> System.Collections.Generic.Dictionary<'Key, 'Element>
<Extension()>
Public Function ToDictionary(Of TKey, TElement, T) (immutableArray As ImmutableArray(Of T), keySelector As Func(Of T, TKey), elementSelector As Func(Of T, TElement)) As Dictionary(Of TKey, TElement)

类型参数

TKey

键的类型。

TElement

元素的类型。

T

集合包含的元素的类型。

参数

immutableArray
ImmutableArray<T>

要从其创建字典的数组。

keySelector
Func<T,TKey>

键选择器。

elementSelector
Func<T,TElement>

元素选择器。

返回

Dictionary<TKey,TElement>

新初始化的字典。

适用于