Edit

Share via


JsonObject.TryGetPropertyValue Method

Definition

Overloads

TryGetPropertyValue(String, JsonNode, Int32)

Gets the value associated with the specified property name.

TryGetPropertyValue(String, JsonNode)

Returns the value of a property with the specified name.

TryGetPropertyValue(String, JsonNode, Int32)

Source:
JsonObject.cs
Source:
JsonObject.cs

Gets the value associated with the specified property name.

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

Parameters

propertyName
String

The property name of the value to get.

jsonNode
JsonNode

When this method returns, it contains the value associated with the specified property name, if the property name is found; otherwise null.

index
Int32

The index of propertyName if found; otherwise, -1.

Returns

true if the JsonObject contains an element with the specified property name; otherwise, false.

Exceptions

propertyName is null.

Applies to

TryGetPropertyValue(String, JsonNode)

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

Returns the value of a property with the specified name.

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

Parameters

propertyName
String

The name of the property to return.

jsonNode
JsonNode

The JSON value of the property with the specified name.

Returns

true if a property with the specified name was found; otherwise, false.

Exceptions

propertyName is null.

Applies to