<PackageReference Include="System.Text.Json" Version="9.0.0" />

JsonProperty

public struct JsonProperty
Represents a single property for a JSON object.
public string Name { get; }

Gets the name of this property.

public JsonElement Value { get; }

Gets the value of this property.

public bool NameEquals(string text)

Compares the specified string to the name of this property.

public bool NameEquals(ReadOnlySpan<byte> utf8Text)

Compares the specified UTF-8 encoded text to the name of this property.

public bool NameEquals(ReadOnlySpan<char> text)

Compares the specified text as a character span to the name of this property.

public void WriteTo(Utf8JsonWriter writer)

Writes the property to the provided writer as a named JSON object property.