JsonElement.TryGetProperty JsonElement.TryGetProperty JsonElement.TryGetProperty JsonElement.TryGetProperty Method

Definition

Overloads

TryGetProperty(String, JsonElement) TryGetProperty(String, JsonElement) TryGetProperty(String, JsonElement) TryGetProperty(String, JsonElement)

Looks for a property named propertyName in the current object, returning a value that indicates whether or not such a property exists. When the property exists, its value is assigned to the value argument.

TryGetProperty(ReadOnlySpan<Byte>, JsonElement) TryGetProperty(ReadOnlySpan<Byte>, JsonElement) TryGetProperty(ReadOnlySpan<Byte>, JsonElement) TryGetProperty(ReadOnlySpan<Byte>, JsonElement)

Looks for a property named utf8PropertyName in the current object, returning a value that indicates whether or not such a property exists. When the property exists, the method assigns its value to the value argument.

TryGetProperty(ReadOnlySpan<Char>, JsonElement) TryGetProperty(ReadOnlySpan<Char>, JsonElement) TryGetProperty(ReadOnlySpan<Char>, JsonElement) TryGetProperty(ReadOnlySpan<Char>, JsonElement)

Looks for a property named propertyName in the current object, returning a value that indicates whether or not such a property exists. When the property exists, the method assigns its value to the value argument.

TryGetProperty(String, JsonElement) TryGetProperty(String, JsonElement) TryGetProperty(String, JsonElement) TryGetProperty(String, JsonElement)

Looks for a property named propertyName in the current object, returning a value that indicates whether or not such a property exists. When the property exists, its value is assigned to the value argument.

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

Parameters

propertyName
String String String String

The name of the property to find.

value
JsonElement JsonElement JsonElement JsonElement

When this method returns, contains the value of the specified property.

Returns

true if the property was found; otherwise, false.

Exceptions

Remarks

Property name matching is performed as an ordinal, case-sensitive comparison.

If a property is defined multiple times for the same object, the method matches the last such definition.

TryGetProperty(ReadOnlySpan<Byte>, JsonElement) TryGetProperty(ReadOnlySpan<Byte>, JsonElement) TryGetProperty(ReadOnlySpan<Byte>, JsonElement) TryGetProperty(ReadOnlySpan<Byte>, JsonElement)

Looks for a property named utf8PropertyName in the current object, returning a value that indicates whether or not such a property exists. When the property exists, the method assigns its value to the value argument.

public:
 bool TryGetProperty(ReadOnlySpan<System::Byte> utf8PropertyName, [Runtime::InteropServices::Out] System::Text::Json::JsonElement % value);
public bool TryGetProperty (ReadOnlySpan<byte> utf8PropertyName, out System.Text.Json.JsonElement value);
member this.TryGetProperty : ReadOnlySpan<byte> * JsonElement -> bool
Public Function TryGetProperty (utf8PropertyName As ReadOnlySpan(Of Byte), ByRef value As JsonElement) As Boolean

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

The UTF-8 (with no Byte-Order-Mark (BOM)) representation of the name of the property to return.

value
JsonElement JsonElement JsonElement JsonElement

Receives the value of the located property.

Returns

true if the property was found; otherwise, false.

Exceptions

Remarks

Property name matching is performed as an ordinal, case-sensitive comparison.

If a property is defined multiple times for the same object, the method matches the last such definition.

TryGetProperty(ReadOnlySpan<Char>, JsonElement) TryGetProperty(ReadOnlySpan<Char>, JsonElement) TryGetProperty(ReadOnlySpan<Char>, JsonElement) TryGetProperty(ReadOnlySpan<Char>, JsonElement)

Looks for a property named propertyName in the current object, returning a value that indicates whether or not such a property exists. When the property exists, the method assigns its value to the value argument.

public:
 bool TryGetProperty(ReadOnlySpan<char> propertyName, [Runtime::InteropServices::Out] System::Text::Json::JsonElement % value);
public bool TryGetProperty (ReadOnlySpan<char> propertyName, out System.Text.Json.JsonElement value);
member this.TryGetProperty : ReadOnlySpan<char> * JsonElement -> bool
Public Function TryGetProperty (propertyName As ReadOnlySpan(Of Char), ByRef value As JsonElement) As Boolean

Parameters

propertyName
ReadOnlySpan<Char>

The name of the property to find.

value
JsonElement JsonElement JsonElement JsonElement

When this method returns, contains the value of the specified property.

Returns

true if the property was found; otherwise, false.

Exceptions

Remarks

Property name matching is performed as an ordinal, case-sensitive comparison.

If a property is defined multiple times for the same object, the method matches the last such definition.

Applies to