JsonObject.Add 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Add(KeyValuePair<String,JsonNode>) |
將指定的屬性加入 JsonObject。 |
| Add(String, JsonNode) |
將所提供的屬性名稱與值加入元素。JsonObject |
Add(KeyValuePair<String,JsonNode>)
將指定的屬性加入 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已經存在一個具有相同屬性名稱的元素。
的 property 性質名稱為 null。
適用於
Add(String, JsonNode)
將所提供的屬性名稱與值加入元素。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
要加入元素的價值。
實作
例外狀況
propertyName是 null。
在 中 JsonObject已經存在一個具有相同屬性名稱的元素。