JsonNodeConversionExtensions Class
Converts between the mutable JSON nodes a token is built from and the read-only elements a model carries.
public static class JsonNodeConversionExtensionsInheritance System.Object → JsonNodeConversionExtensions
Methods
JsonNodeConversionExtensions.ToJsonElement(this JsonNode) Method
Converts a JsonNode to a JsonElement.
public static System.Text.Json.JsonElement ToJsonElement(this System.Text.Json.Nodes.JsonNode? jsonNode);Parameters
jsonNode System.Text.Json.Nodes.JsonNode
The JsonNode to convert.
Returns
System.Text.Json.JsonElement
The converted JsonElement.
JsonNodeConversionExtensions.ToJsonNode(this JsonElement) Method
Converts a JsonElement to a JsonNode, allowing for more dynamic manipulation of the JSON structure.
public static System.Text.Json.Nodes.JsonNode? ToJsonNode(this System.Text.Json.JsonElement jsonElement);Parameters
jsonElement System.Text.Json.JsonElement
The JsonElement to convert.
Returns
System.Text.Json.Nodes.JsonNode
The converted JsonNode.
Remarks
This method is useful when you need to convert from a structured JsonElement to a more flexible JsonNode.