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>

新的不可變字典,其中包含指定的項目,並使用指定的比較子。

適用於