Home JsonDocumentEqualityComparer Class
JsonDocumentEqualityComparer Class
Cancel

JsonDocumentEqualityComparer Class

Namespace: Json.More

Inheritance: JsonDocumentEqualityComparer 🡒 object

Implemented interfaces:

  • IEqualityComparer<JsonDocument>

Calculates equality between two System.Text.Json.JsonDocuments.

Remarks

This comparison is compliant with the ideals expressed by JSON:

  • Objects are unordered.
  • Arrays are ordered.

Properties

NameTypeSummary
InstanceJsonDocumentEqualityComparerA singleton instance for convenience.

Methods

Equals(JsonDocument x, JsonDocument y)

Determines whether the specified objects are equal.

Declaration

1
public bool Equals(JsonDocument x, JsonDocument y)
ParameterTypeDescription
xJsonDocumentThe first object of type T to compare.
yJsonDocumentThe second object of type T to compare.

Returns

true if the specified objects are equal; otherwise, false.

GetHashCode(JsonDocument obj)

Returns a hash code for the specified object.

Declaration

1
public int GetHashCode(JsonDocument obj)
ParameterTypeDescription
objJsonDocumentThe System.Object for which a hash code is to be returned.

Returns

A hash code for the specified object.

Contents