語言

ImmutableDictionary<TKey,TValue>.AddRange 方法

定義

將指定的索引鍵/值組加入至不可變的字典。

public:
 System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ AddRange(System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ pairs);
public System.Collections.Immutable.ImmutableDictionary<TKey,TValue> AddRange(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> pairs);
member this.AddRange : seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function AddRange (pairs As IEnumerable(Of KeyValuePair(Of TKey, TValue))) As ImmutableDictionary(Of TKey, TValue)

參數

pairs
IEnumerable<KeyValuePair<TKey,TValue>>

要加的鍵值對。

傳回

一個新的不可變字典,包含額外的鍵值對。

例外狀況

其中一個給定的鍵已經存在於字典中,但值不同。

適用於