ImmutableDictionary<TKey,TValue>.AddRange 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定的索引鍵/值組加入至不可變的字典。
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>>
要加的鍵值對。
傳回
一個新的不可變字典,包含額外的鍵值對。
例外狀況
其中一個給定的鍵已經存在於字典中,但值不同。