Share via


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> 对象中已存在具有相同键的元素。

适用于