<PackageReference Include="System.Text.Json" Version="7.0.0-rc.1.22426.10" />

JsonNode

public abstract class JsonNode
The base class that represents a single node within a mutable JSON document.
public JsonNode this[int index] { get; set; }

Gets or sets the element at the specified index.

public JsonNode this[string propertyName] { get; set; }

Gets or sets the element with the specified property name. If the property is not found, null is returned.

public JsonNodeOptions? Options { get; }

Gets the options to control the behavior.

public JsonNode Parent { get; }

Gets the parent JsonNode. If there is no parent, null is returned. A parent can either be a JsonObject or a JsonArray.

public JsonNode Root { get; }

Gets the root JsonNode. If the current JsonNode is a root, null is returned.

public static bool op_Explicit(JsonNode value)

Defines an explicit conversion of a given Boolean to a JsonNode.

public static bool? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Boolean to a JsonNode.

public static byte op_Explicit(JsonNode value)

Defines an explicit conversion of a given Byte to a JsonNode.

public static byte? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Byte to a JsonNode.

public static char op_Explicit(JsonNode value)

Defines an explicit conversion of a given Char to a JsonNode.

public static char? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Char to a JsonNode.

public static DateTime op_Explicit(JsonNode value)

Defines an explicit conversion of a given DateTime to a JsonNode.

public static DateTime? op_Explicit(JsonNode value)

Defines an explicit conversion of a given DateTime to a JsonNode.

public static DateTimeOffset op_Explicit(JsonNode value)

Defines an explicit conversion of a given DateTimeOffset to a JsonNode.

public static DateTimeOffset? op_Explicit(JsonNode value)

Defines an explicit conversion of a given DateTimeOffset to a JsonNode.

public static decimal op_Explicit(JsonNode value)

Defines an explicit conversion of a given Decimal to a JsonNode.

public static decimal? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Decimal to a JsonNode.

public static double op_Explicit(JsonNode value)

Defines an explicit conversion of a given Double to a JsonNode.

public static double? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Double to a JsonNode.

public static Guid op_Explicit(JsonNode value)

Defines an explicit conversion of a given Guid to a JsonNode.

public static Guid? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Guid to a JsonNode.

public static short op_Explicit(JsonNode value)

Defines an explicit conversion of a given Int16 to a JsonNode.

public static short? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Int16 to a JsonNode.

public static int op_Explicit(JsonNode value)

Defines an explicit conversion of a given Int32 to a JsonNode.

public static int? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Int32 to a JsonNode.

public static long op_Explicit(JsonNode value)

Defines an explicit conversion of a given Int64 to a JsonNode.

public static long? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Int64 to a JsonNode.

public static sbyte op_Explicit(JsonNode value)

Defines an explicit conversion of a given SByte to a JsonNode.

public static sbyte? op_Explicit(JsonNode value)

Defines an explicit conversion of a given SByte to a JsonNode.

public static float op_Explicit(JsonNode value)

Defines an explicit conversion of a given Single to a JsonNode.

public static float? op_Explicit(JsonNode value)

Defines an explicit conversion of a given Single to a JsonNode.

public static string op_Explicit(JsonNode value)

Defines an explicit conversion of a given String to a JsonNode.

public static ushort op_Explicit(JsonNode value)

Defines an explicit conversion of a given UInt16 to a JsonNode.

public static ushort? op_Explicit(JsonNode value)

Defines an explicit conversion of a given UInt16 to a JsonNode.

public static uint op_Explicit(JsonNode value)

Defines an explicit conversion of a given UInt32 to a JsonNode.

public static uint? op_Explicit(JsonNode value)

Defines an explicit conversion of a given UInt32 to a JsonNode.

public static ulong op_Explicit(JsonNode value)

Defines an explicit conversion of a given UInt64 to a JsonNode.

public static ulong? op_Explicit(JsonNode value)

Defines an explicit conversion of a given UInt64 to a JsonNode.

public static JsonNode op_Implicit(bool value)

Defines an implicit conversion of a given Boolean to a JsonNode.

public static JsonNode op_Implicit(bool? value)

Defines an implicit conversion of a given Boolean to a JsonNode.

public static JsonNode op_Implicit(byte value)

Defines an implicit conversion of a given Byte to a JsonNode.

public static JsonNode op_Implicit(byte? value)

Defines an implicit conversion of a given Byte to a JsonNode.

public static JsonNode op_Implicit(char value)

Defines an implicit conversion of a given Char to a JsonNode.

public static JsonNode op_Implicit(char? value)

Defines an implicit conversion of a given Char to a JsonNode.

public static JsonNode op_Implicit(DateTime value)

Defines an implicit conversion of a given DateTime to a JsonNode.

public static JsonNode op_Implicit(DateTime? value)

Defines an implicit conversion of a given DateTime to a JsonNode.

public static JsonNode op_Implicit(DateTimeOffset value)

Defines an implicit conversion of a given DateTimeOffset to a JsonNode.

public static JsonNode op_Implicit(DateTimeOffset? value)

Defines an implicit conversion of a given DateTimeOffset to a JsonNode.

public static JsonNode op_Implicit(decimal value)

Defines an implicit conversion of a given Decimal to a JsonNode.

public static JsonNode op_Implicit(decimal? value)

Defines an implicit conversion of a given Decimal to a JsonNode.

public static JsonNode op_Implicit(double value)

Defines an implicit conversion of a given Double to a JsonNode.

public static JsonNode op_Implicit(double? value)

Defines an implicit conversion of a given Double to a JsonNode.

public static JsonNode op_Implicit(Guid value)

Defines an implicit conversion of a given Guid to a JsonNode.

public static JsonNode op_Implicit(Guid? value)

Defines an implicit conversion of a given Guid to a JsonNode.

public static JsonNode op_Implicit(short value)

Defines an implicit conversion of a given Int16 to a JsonNode.

public static JsonNode op_Implicit(short? value)

Defines an implicit conversion of a given Int16 to a JsonNode.

public static JsonNode op_Implicit(int value)

Defines an implicit conversion of a given Int32 to a JsonNode.

public static JsonNode op_Implicit(int? value)

Defines an implicit conversion of a given Int32 to a JsonNode.

public static JsonNode op_Implicit(long value)

Defines an implicit conversion of a given Int64 to a JsonNode.

public static JsonNode op_Implicit(long? value)

Defines an implicit conversion of a given Int64 to a JsonNode.

public static JsonNode op_Implicit(sbyte value)

Defines an implicit conversion of a given SByte to a JsonNode.

public static JsonNode op_Implicit(sbyte? value)

Defines an implicit conversion of a given SByte to a JsonNode.

public static JsonNode op_Implicit(float value)

Defines an implicit conversion of a given Single to a JsonNode.

public static JsonNode op_Implicit(float? value)

Defines an implicit conversion of a given Single to a JsonNode.

public static JsonNode op_Implicit(string value)

Defines an implicit conversion of a given String to a JsonNode.

public static JsonNode op_Implicit(ushort value)

Defines an implicit conversion of a given UInt16 to a JsonNode.

public static JsonNode op_Implicit(ushort? value)

Defines an implicit conversion of a given UInt16 to a JsonNode.

public static JsonNode op_Implicit(uint value)

Defines an implicit conversion of a given UInt32 to a JsonNode.

public static JsonNode op_Implicit(uint? value)

Defines an implicit conversion of a given UInt32 to a JsonNode.

public static JsonNode op_Implicit(ulong value)

Defines an implicit conversion of a given UInt64 to a JsonNode.

public static JsonNode op_Implicit(ulong? value)

Defines an implicit conversion of a given UInt64 to a JsonNode.

public static JsonNode Parse(ref Utf8JsonReader reader, JsonNodeOptions? nodeOptions = default)

Parses one JSON value (including objects or arrays) from the provided reader.

public static JsonNode Parse(string json, JsonNodeOptions? nodeOptions = default, JsonDocumentOptions documentOptions = default)

Parses text representing a single JSON value.

public static JsonNode Parse(ReadOnlySpan<byte> utf8Json, JsonNodeOptions? nodeOptions = default, JsonDocumentOptions documentOptions = default)

Parses text representing a single JSON value.

public static JsonNode Parse(Stream utf8Json, JsonNodeOptions? nodeOptions = default, JsonDocumentOptions documentOptions = default)

Parses a Stream as UTF-8-encoded data representing a single JSON value into a JsonNode. The Stream will be read to completion.

public JsonArray AsArray()

Casts to the derived JsonArray type.

Casts to the derived JsonObject type.

public JsonValue AsValue()

Casts to the derived JsonValue type.

public string GetPath()

Gets the JSON path.

public virtual T GetValue<T>()

Gets the value for the current JsonValue.

public string ToJsonString(JsonSerializerOptions options = null)

Converts the current instance to string in JSON format.

public abstract void WriteTo(Utf8JsonWriter writer, JsonSerializerOptions options = null)

Writes the JsonNode into the provided Utf8JsonWriter as JSON.