Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Text.​Json.​JsonProperty

Assembly: System.Text.Json

Represents a single property for a JSON object.

Properties

public string
Name
Gets the name of this property.
public JsonElement
Value
Gets the value of this property.

Methods

public bool
NameEquals​(ReadOnlySpan<​byte> utf8Text)
Compares the specified UTF-8 encoded text to the name of this property.
Returns <see langword="true" /> if the name of this property has the same UTF-8 encoding as <paramref name="utf8Text" /> ; otherwise, <see langword="false" /> .
utf8Text The UTF-8 encoded text to compare against.
public bool
NameEquals​(ReadOnlySpan<​char> text)
Compares the specified text as a character span to the name of this property.
Returns <see langword="true" /> if the name of this property matches <paramref name="text" /> ; otherwise, <see langword="false" /> .
text The text to compare against.
public bool
NameEquals​(string text)
Compares the specified string to the name of this property.
Returns <see langword="true" /> if the name of this property matches <paramref name="text" /> ; otherwise <see langword="false" /> .
text The text to compare against.
public string
ToString​()
Provides a string representation of the property for debugging purposes.
Returns A string containing the uninterpreted value of the property, beginning at the declaring open-quote and ending at the last character that is part of the value.
public void
WriteTo​(Utf8JsonWriter writer)
Writes the property to the provided writer as a named JSON object property.
writer The writer to which to write the property.
public bool
Equals​(object obj)
Inherited from ValueType
public int
GetHashCode​()
Inherited from ValueType
protected void
Finalize​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object