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

定义

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

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

参数

pairs
IEnumerable<KeyValuePair<TKey,TValue>>

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

返回

IImmutableDictionary<TKey,TValue>

一个新的不可变字典,其中包含其他键/值对。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.

适用于