JsonObject.Add 方法

定义

重载

Add(KeyValuePair<String,JsonNode>)

将指定的属性添加到 JsonObject

Add(String, JsonNode)

将具有提供的属性名称和值的元素添加到 。JsonObject

Add(KeyValuePair<String,JsonNode>)

Source:
JsonObject.IDictionary.cs
Source:
JsonObject.IDictionary.cs
Source:
JsonObject.IDictionary.cs

将指定的属性添加到 JsonObject

public:
 virtual void Add(System::Collections::Generic::KeyValuePair<System::String ^, System::Text::Json::Nodes::JsonNode ^> property);
public void Add (System.Collections.Generic.KeyValuePair<string,System.Text.Json.Nodes.JsonNode?> property);
abstract member Add : System.Collections.Generic.KeyValuePair<string, System.Text.Json.Nodes.JsonNode> -> unit
override this.Add : System.Collections.Generic.KeyValuePair<string, System.Text.Json.Nodes.JsonNode> -> unit
Public Sub Add (property As KeyValuePair(Of String, JsonNode))

参数

property
KeyValuePair<String,JsonNode>

KeyValuePair 结构,表示要添加到 的属性 JsonObject名称和值。

实现

例外

中已存在具有相同属性名称的 JsonObject元素。

的属性名称 propertynull

适用于

Add(String, JsonNode)

Source:
JsonObject.IDictionary.cs
Source:
JsonObject.IDictionary.cs
Source:
JsonObject.IDictionary.cs

将具有提供的属性名称和值的元素添加到 。JsonObject

public:
 virtual void Add(System::String ^ propertyName, System::Text::Json::Nodes::JsonNode ^ value);
public void Add (string propertyName, System.Text.Json.Nodes.JsonNode? value);
abstract member Add : string * System.Text.Json.Nodes.JsonNode -> unit
override this.Add : string * System.Text.Json.Nodes.JsonNode -> unit
Public Sub Add (propertyName As String, value As JsonNode)

参数

propertyName
String

要添加的元素的属性名称。

value
JsonNode

要添加的元素的值。

实现

例外

propertyNamenull

中已存在具有相同属性名称的 JsonObject元素。

适用于