JsonObject.Add Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
- Source:
- JsonObject.IDictionary.cs
- Source:
- JsonObject.IDictionary.cs
- Source:
- JsonObject.IDictionary.cs
- 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
.NET 10 and other versions
Product | Versions |
---|---|
.NET | 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
- Source:
- JsonObject.IDictionary.cs
- Source:
- JsonObject.IDictionary.cs
- Source:
- JsonObject.IDictionary.cs
- 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
propertyName
is null
.
An element with the same property name already exists in the JsonObject.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: