IImmutableDictionary<TKey,TValue>.SetItems(IEnumerable<KeyValuePair<TKey,TValue>>) IImmutableDictionary<TKey,TValue>.SetItems(IEnumerable<KeyValuePair<TKey,TValue>>) IImmutableDictionary<TKey,TValue>.SetItems(IEnumerable<KeyValuePair<TKey,TValue>>) IImmutableDictionary<TKey,TValue>.SetItems(IEnumerable<KeyValuePair<TKey,TValue>>) Method

定义

在不可变字典中设置指定的键/值对,可能的设置方法是覆盖键的现有值。Sets the specified key/value pairs in the immutable dictionary, possibly overwriting existing values for the keys.

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

参数

items
IEnumerable<KeyValuePair<TKey,TValue>>

要在字典中设置的键/值对。The key/value pairs to set in the dictionary. 如果字典中已存在任何键,则此方法将覆盖这些键的先前值。If any of the keys already exist in the dictionary, this method will overwrite their previous values.

返回

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

适用于