Home JsonDocumentExtensions Class
JsonDocumentExtensions Class
Cancel

JsonDocumentExtensions Class

Namespace: Json.More

Inheritance: JsonDocumentExtensions 🡒 object

Provides extension functionality for System.Text.Json.JsonDocument.

Methods

IsEquivalentTo(this JsonDocument a, JsonDocument b)

Determines JSON-compatible equivalence.

Declaration

1
public static bool IsEquivalentTo(this JsonDocument a, JsonDocument b)
ParameterTypeDescription
aJsonDocumentThe first document.
bJsonDocumentThe second document.

Returns

true if the documents are equivalent; false otherwise.

ToJsonDocument(this T value, JsonSerializerOptions options)

Converts an object to a System.Text.Json.JsonDocument.

Declaration

1
public static JsonDocument ToJsonDocument(this T value, JsonSerializerOptions options)
ParameterTypeDescription
valueTThe value to convert.
optionsJsonSerializerOptions(optional) JSON serialization options.

Returns

A System.Text.Json.JsonDocument representing the vale.

Contents