ImmutableDictionary.CreateRange 方法

定义

重载

CreateRange<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>)

创建包含指定项的新不可变字典。

CreateRange<TKey,TValue>(IEqualityComparer<TKey>, IEnumerable<KeyValuePair<TKey,TValue>>)

创建包含指定项并使用指定键比较器的新不可变字典。

CreateRange<TKey,TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>, IEnumerable<KeyValuePair<TKey,TValue>>)

创建包含指定项并使用指定键比较器的新不可变字典。

CreateRange<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>)

创建包含指定项的新不可变字典。

public:
generic <typename TKey, typename TValue>
 static System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ CreateRange(System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue> (System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
static member CreateRange : seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function CreateRange(Of TKey, TValue) (items As IEnumerable(Of KeyValuePair(Of TKey, TValue))) As ImmutableDictionary(Of TKey, TValue)

类型参数

TKey

字典中的键的类型。

TValue

字典中值的类型。

参数

items
IEnumerable<KeyValuePair<TKey,TValue>>

在字典不可变之前用于填充该字典的项。

返回

ImmutableDictionary<TKey,TValue>

包含指定项的新不可变字典。

适用于

CreateRange<TKey,TValue>(IEqualityComparer<TKey>, IEnumerable<KeyValuePair<TKey,TValue>>)

创建包含指定项并使用指定键比较器的新不可变字典。

public:
generic <typename TKey, typename TValue>
 static System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ CreateRange(System::Collections::Generic::IEqualityComparer<TKey> ^ keyComparer, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue> (System.Collections.Generic.IEqualityComparer<TKey> keyComparer, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue> (System.Collections.Generic.IEqualityComparer<TKey>? keyComparer, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
static member CreateRange : System.Collections.Generic.IEqualityComparer<'Key> * seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function CreateRange(Of TKey, TValue) (keyComparer As IEqualityComparer(Of TKey), items As IEnumerable(Of KeyValuePair(Of TKey, TValue))) As ImmutableDictionary(Of TKey, TValue)

类型参数

TKey

字典中的键的类型。

TValue

字典中值的类型。

参数

keyComparer
IEqualityComparer<TKey>

用于比较键的相等性的比较器实现。

items
IEnumerable<KeyValuePair<TKey,TValue>>

在字典不可变之前要添加到该字典中的项。

返回

ImmutableDictionary<TKey,TValue>

包含指定项并使用指定比较器的新不可变字典。

适用于

CreateRange<TKey,TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>, IEnumerable<KeyValuePair<TKey,TValue>>)

创建包含指定项并使用指定键比较器的新不可变字典。

public:
generic <typename TKey, typename TValue>
 static System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ CreateRange(System::Collections::Generic::IEqualityComparer<TKey> ^ keyComparer, System::Collections::Generic::IEqualityComparer<TValue> ^ valueComparer, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue> (System.Collections.Generic.IEqualityComparer<TKey> keyComparer, System.Collections.Generic.IEqualityComparer<TValue> valueComparer, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue> (System.Collections.Generic.IEqualityComparer<TKey>? keyComparer, System.Collections.Generic.IEqualityComparer<TValue>? valueComparer, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
static member CreateRange : System.Collections.Generic.IEqualityComparer<'Key> * System.Collections.Generic.IEqualityComparer<'Value> * seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function CreateRange(Of TKey, TValue) (keyComparer As IEqualityComparer(Of TKey), valueComparer As IEqualityComparer(Of TValue), items As IEnumerable(Of KeyValuePair(Of TKey, TValue))) As ImmutableDictionary(Of TKey, TValue)

类型参数

TKey

字典中的键的类型。

TValue

字典中值的类型。

参数

keyComparer
IEqualityComparer<TKey>

用于比较键的相等性的比较器实现。

valueComparer
IEqualityComparer<TValue>

用于比较值的相等性的比较器实现。

items
IEnumerable<KeyValuePair<TKey,TValue>>

在字典不可变之前要添加到该字典中的项。

返回

ImmutableDictionary<TKey,TValue>

包含指定项并使用指定比较器的新不可变字典。

适用于