ImmutableDictionary<TKey,TValue>.AddRange(IEnumerable<KeyValuePair<TKey,TValue>>) 方法

定义

将指定的键/值对添加到不可变字典。Adds the specified key/value pairs to the immutable dictionary.

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>>

要添加的键/值对。The key/value pairs to add.

返回

一个新的不可变字典,其中包含其他键/值对。A new immutable dictionary that contains the additional key/value pairs.

异常

字典中已存在其中一个给定的键,但具有不同的值。One of the given keys already exists in the dictionary but has a different value.

适用于