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

JsonObject

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

Gets the number of elements contained in JsonObject.

public JsonObject(JsonNodeOptions? options = default)

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

public JsonObject(IEnumerable<KeyValuePair<string, JsonNode>> properties, JsonNodeOptions? options = default)

Initializes a new instance of the JsonObject class that contains the specified properties.

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

Initializes a new instance of the JsonObject class that contains properties from the specified JsonElement.

public void Add(string propertyName, JsonNode value)

Adds an element with the provided property name and value to the JsonObject.

public void Add(KeyValuePair<string, JsonNode> property)

Adds the specified property to the JsonObject.

public void Clear()

Removes all elements from the JsonObject.

public bool ContainsKey(string propertyName)

Determines whether the JsonObject contains an element with the specified property name.

public KeyValuePair<string, JsonNode> GetAt(int index)

Returns an enumerator that iterates through the JsonObject.

public int IndexOf(string propertyName)

public void Insert(int index, string propertyName, JsonNode value)

public bool Remove(string propertyName)

Removes the element with the specified property name from the JsonObject.

public void RemoveAt(int index)

public void SetAt(int index, string propertyName, JsonNode value)

public void SetAt(int index, JsonNode value)

public bool TryGetPropertyValue(string propertyName, out JsonNode jsonNode)

Returns the value of a property with the specified name.