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,JsonValue>) |
Adds an item to the ICollection<T>. |
Add(String, JsonValue) |
Adds an element with the provided key and value to the IDictionary<TKey,TValue>. |
- Source:
- JsonObject.cs
Adds an item to the ICollection<T>.
public:
virtual void Add(System::Collections::Generic::KeyValuePair<System::String ^, System::Json::JsonValue ^> pair);
public void Add(System.Collections.Generic.KeyValuePair<string,System.Json.JsonValue> pair);
abstract member Add : System.Collections.Generic.KeyValuePair<string, System.Json.JsonValue> -> unit
override this.Add : System.Collections.Generic.KeyValuePair<string, System.Json.JsonValue> -> unit
Public Sub Add (pair As KeyValuePair(Of String, JsonValue))
Parameters
- pair
- KeyValuePair<String,JsonValue>
Implements
Remarks
Note
The System.Json namespace was designed for Silverlight, which is no longer supported. For processing JSON, we recommend using APIs in the System.Text.Json namespace instead.
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- JsonObject.cs
Adds an element with the provided key and value to the IDictionary<TKey,TValue>.
public:
virtual void Add(System::String ^ key, System::Json::JsonValue ^ value);
public void Add(string key, System.Json.JsonValue value);
abstract member Add : string * System.Json.JsonValue -> unit
override this.Add : string * System.Json.JsonValue -> unit
Public Sub Add (key As String, value As JsonValue)
Parameters
- key
- String
The object to use as the key of the element to add.
- value
- JsonValue
The object to use as the value of the element to add.
Implements
Remarks
Note
The System.Json namespace was designed for Silverlight, which is no longer supported. For processing JSON, we recommend using APIs in the System.Text.Json namespace instead.
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: