ImmutableDictionary<TKey,TValue>.Builder.Add 方法

定義

多載

Add(KeyValuePair<TKey,TValue>)

將指定的項目加入不可變的字典。

Add(TKey, TValue)

將具有指定索引鍵和值的項目加入不可變的字典。

Add(KeyValuePair<TKey,TValue>)

將指定的項目加入不可變的字典。

public:
 virtual void Add(System::Collections::Generic::KeyValuePair<TKey, TValue> item);
public void Add (System.Collections.Generic.KeyValuePair<TKey,TValue> item);
abstract member Add : System.Collections.Generic.KeyValuePair<'Key, 'Value> -> unit
override this.Add : System.Collections.Generic.KeyValuePair<'Key, 'Value> -> unit
Public Sub Add (item As KeyValuePair(Of TKey, TValue))

參數

item
KeyValuePair<TKey,TValue>

要加入字典的物件。

實作

例外狀況

字典是唯讀的。

適用於

Add(TKey, TValue)

將具有指定索引鍵和值的項目加入不可變的字典。

public:
 virtual void Add(TKey key, TValue value);
public void Add (TKey key, TValue value);
abstract member Add : 'Key * 'Value -> unit
override this.Add : 'Key * 'Value -> unit
Public Sub Add (key As TKey, value As TValue)

參數

key
TKey

要加入的項目的索引鍵。

value
TValue

要加入的項目的值。

實作

例外狀況

key 為 null。

字典中存在具有相同索引鍵的項目。

字典是唯讀的。

適用於