Edit

Share via


JsonObject.Add Method

Definition

Overloads

Add(KeyValuePair<String,JsonNode>)

Adds the specified property to the JsonObject.

Add(String, JsonNode)

Adds an element with the provided property name and value to the JsonObject.

Add(KeyValuePair<String,JsonNode>)

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

Adds the specified property to the 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))

Parameters

property
KeyValuePair<String,JsonNode>

The KeyValuePair structure representing the property name and value to add to the JsonObject.

Implements

Exceptions

An element with the same property name already exists in the JsonObject.

The property name of property is null.

Applies to

Add(String, JsonNode)

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

Adds an element with the provided property name and value to the 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)

Parameters

propertyName
String

The property name of the element to add.

value
JsonNode

The value of the element to add.

Implements

Exceptions

propertyNameis null.

An element with the same property name already exists in the JsonObject.

Applies to