共用方式為


ViewDataDictionary.Add 方法

定義

多載

Add(KeyValuePair<String,Object>)

將指定的項目加入至集合。

Add(String, Object)

使用指定的索引鍵和值,將專案加入至集合。

Add(KeyValuePair<String,Object>)

將指定的項目加入至集合。

public void Add (System.Collections.Generic.KeyValuePair<string,object> item);
abstract member Add : System.Collections.Generic.KeyValuePair<string, obj> -> unit
override this.Add : System.Collections.Generic.KeyValuePair<string, obj> -> unit
Public Sub Add (item As KeyValuePair(Of String, Object))

參數

item
KeyValuePair<String,Object>

要新增至集合的物件。

實作

例外狀況

集合是唯讀的。

適用於

Add(String, Object)

使用指定的索引鍵和值,將專案加入至集合。

public void Add (string key, object value);
abstract member Add : string * obj -> unit
override this.Add : string * obj -> unit
Public Sub Add (key As String, value As Object)

參數

key
String

要加入的項目的索引鍵。

value
Object

要加入的項目的值。

實作

例外狀況

key 為 null。

具有相同索引鍵的項目已經存在 IDictionary<TKey,TValue> 物件中。

適用於