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

JsonArray

Represents a mutable JSON array.
public int Count { get; }

Gets the number of elements contained in the JsonArray.

public JsonArray(JsonNodeOptions? options = default)

Initializes a new instance of the JsonArray class that is empty.

public JsonArray(JsonNodeOptions options, JsonNode[] items)

Initializes a new instance of the JsonArray class that contains items from the specified params array.

public JsonArray(JsonNode[] items)

Initializes a new instance of the JsonArray class that contains items from the specified array.

public static JsonArray Create(JsonElement element, JsonNodeOptions? options = default)

Initializes a new instance of the JsonArray class that contains items from the specified JsonElement.

public void Add<T>(T value)

Adds an object to the end of the JsonArray.

public void Add(JsonNode item)

Adds a JsonNode to the end of the JsonArray.

public void Clear()

Removes all elements from the JsonArray.

public bool Contains(JsonNode item)

Determines whether an element is in the JsonArray.

Returns an enumerator that iterates through the JsonArray.

public int IndexOf(JsonNode item)

The object to locate in the JsonArray.

public void Insert(int index, JsonNode item)

Inserts an element into the JsonArray at the specified index.

public bool Remove(JsonNode item)

Removes the first occurrence of a specific JsonNode from the JsonArray.

public void RemoveAt(int index)

Removes the element at the specified index of the JsonArray.