JsonElement.GetProperty Method

Definition

Overloads

GetProperty(ReadOnlySpan<Byte>)

Gets a JsonElement representing the value of a required property identified by utf8PropertyName.

GetProperty(ReadOnlySpan<Char>)

Gets a JsonElement representing the value of a required property identified by propertyName.

GetProperty(String)

Gets a JsonElement representing the value of a required property identified by propertyName.

GetProperty(ReadOnlySpan<Byte>)

Gets a JsonElement representing the value of a required property identified by utf8PropertyName.

public:
 System::Text::Json::JsonElement GetProperty(ReadOnlySpan<System::Byte> utf8PropertyName);
public System.Text.Json.JsonElement GetProperty (ReadOnlySpan<byte> utf8PropertyName);
member this.GetProperty : ReadOnlySpan<byte> -> System.Text.Json.JsonElement
Public Function GetProperty (utf8PropertyName As ReadOnlySpan(Of Byte)) As JsonElement

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

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

Returns

JsonElement

A JsonElement representing the value of the requested property.

Exceptions

No property was found with the requested name.

The parent JsonDocument has been disposed.

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.

For more information, see How to serialize and deserialize JSON.

GetProperty(ReadOnlySpan<Char>)

Gets a JsonElement representing the value of a required property identified by propertyName.

public:
 System::Text::Json::JsonElement GetProperty(ReadOnlySpan<char> propertyName);
public System.Text.Json.JsonElement GetProperty (ReadOnlySpan<char> propertyName);
member this.GetProperty : ReadOnlySpan<char> -> System.Text.Json.JsonElement
Public Function GetProperty (propertyName As ReadOnlySpan(Of Char)) As JsonElement

Parameters

propertyName
ReadOnlySpan<Char>

The name of the property whose value is to be returned.

Returns

JsonElement

A JsonElement representing the value of the requested property.

Exceptions

No property was found with the requested name.

The parent JsonDocument has been disposed.

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.

GetProperty(String)

Gets a JsonElement representing the value of a required property identified by propertyName.

public:
 System::Text::Json::JsonElement GetProperty(System::String ^ propertyName);
public System.Text.Json.JsonElement GetProperty (string propertyName);
member this.GetProperty : string -> System.Text.Json.JsonElement
Public Function GetProperty (propertyName As String) As JsonElement

Parameters

propertyName
String

The name of the property whose value is to be returned.

Returns

JsonElement

A JsonElement representing the value of the requested property.

Exceptions

No property was found with the requested name.

propertyName is null.

The parent JsonDocument has been disposed.

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