JsonObject.TryAdd Metodo

Definizione

Overload

Nome Descrizione
TryAdd(String, JsonNode, Int32)

Aggiunge un elemento con il nome e il valore specificati a JsonObject, se non esiste già una proprietà denominata propertyName .

TryAdd(String, JsonNode)

Aggiunge un elemento con il nome e il valore specificati a JsonObject, se non esiste già una proprietà denominata propertyName .

TryAdd(String, JsonNode, Int32)

Origine:
JsonObject.IDictionary.cs
Origine:
JsonObject.IDictionary.cs
Origine:
JsonObject.IDictionary.cs

Aggiunge un elemento con il nome e il valore specificati a JsonObject, se non esiste già una proprietà denominata propertyName .

public:
 bool TryAdd(System::String ^ propertyName, System::Text::Json::Nodes::JsonNode ^ value, [Runtime::InteropServices::Out] int % index);
public bool TryAdd(string propertyName, System.Text.Json.Nodes.JsonNode? value, out int index);
member this.TryAdd : string * System.Text.Json.Nodes.JsonNode * int -> bool
Public Function TryAdd (propertyName As String, value As JsonNode, ByRef index As Integer) As Boolean

Parametri

propertyName
String

Nome della proprietà dell'elemento da aggiungere.

value
JsonNode

Valore dell'elemento da aggiungere.

index
Int32

Indice dell'oggetto aggiunto o esistente propertyName. Si tratta sempre di un indice valido nell'oggetto JsonObject.

Valori restituiti

true se la proprietà non esiste e l'elemento è stato aggiunto; in caso contrario, false.

Eccezioni

propertyName è null.

Si applica a

TryAdd(String, JsonNode)

Origine:
JsonObject.IDictionary.cs
Origine:
JsonObject.IDictionary.cs
Origine:
JsonObject.IDictionary.cs

Aggiunge un elemento con il nome e il valore specificati a JsonObject, se non esiste già una proprietà denominata propertyName .

public:
 bool TryAdd(System::String ^ propertyName, System::Text::Json::Nodes::JsonNode ^ value);
public bool TryAdd(string propertyName, System.Text.Json.Nodes.JsonNode? value);
member this.TryAdd : string * System.Text.Json.Nodes.JsonNode -> bool
Public Function TryAdd (propertyName As String, value As JsonNode) As Boolean

Parametri

propertyName
String

Nome della proprietà dell'elemento da aggiungere.

value
JsonNode

Valore dell'elemento da aggiungere.

Valori restituiti

true se la proprietà non esiste e l'elemento è stato aggiunto; in caso contrario, false.

Eccezioni

propertyName è null.

Si applica a