JsonArray Constructors

Definition

Overloads

JsonArray(Nullable<JsonNodeOptions>)

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

JsonArray(ReadOnlySpan<JsonNode>)

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

JsonArray(JsonNode[])

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

JsonArray(JsonNodeOptions, ReadOnlySpan<JsonNode>)

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

JsonArray(JsonNodeOptions, JsonNode[])

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

JsonArray(Nullable<JsonNodeOptions>)

Source:
JsonArray.cs
Source:
JsonArray.cs
Source:
JsonArray.cs
Source:
JsonArray.cs
Source:
JsonArray.cs

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

C#
public JsonArray(System.Text.Json.Nodes.JsonNodeOptions? options = default);

Parameters

options
Nullable<JsonNodeOptions>

Options to control the behavior.

Applies to

.NET 9 and other versions
Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

JsonArray(ReadOnlySpan<JsonNode>)

Source:
JsonArray.cs

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

C#
public JsonArray(scoped ReadOnlySpan<System.Text.Json.Nodes.JsonNode?> items);

Parameters

items
ReadOnlySpan<JsonNode>

The items to add to the new JsonArray.

Applies to

.NET 9 and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

JsonArray(JsonNode[])

Source:
JsonArray.cs
Source:
JsonArray.cs
Source:
JsonArray.cs
Source:
JsonArray.cs
Source:
JsonArray.cs

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

C#
public JsonArray(params System.Text.Json.Nodes.JsonNode?[] items);

Parameters

items
JsonNode[]

The items to add to the new JsonArray.

Applies to

.NET 9 and other versions
Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

JsonArray(JsonNodeOptions, ReadOnlySpan<JsonNode>)

Source:
JsonArray.cs

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

C#
public JsonArray(System.Text.Json.Nodes.JsonNodeOptions options, scoped ReadOnlySpan<System.Text.Json.Nodes.JsonNode?> items);

Parameters

options
JsonNodeOptions

Options to control the behavior.

items
ReadOnlySpan<JsonNode>

The items to add to the new JsonArray.

Applies to

.NET 9 and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

JsonArray(JsonNodeOptions, JsonNode[])

Source:
JsonArray.cs
Source:
JsonArray.cs
Source:
JsonArray.cs
Source:
JsonArray.cs
Source:
JsonArray.cs

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

C#
public JsonArray(System.Text.Json.Nodes.JsonNodeOptions options, params System.Text.Json.Nodes.JsonNode?[] items);

Parameters

options
JsonNodeOptions

Options to control the behavior.

items
JsonNode[]

The items to add to the new JsonArray.

Applies to

.NET 9 and other versions
Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)