<PackageReference Include="System.Text.Json" Version="6.0.10" />

ReferenceEqualityComparer

An IEqualityComparer<T> that uses reference equality ( ReferenceEquals) instead of value equality ( Equals) when comparing two object instances.
public static ReferenceEqualityComparer Instance { get; }

Gets the singleton ReferenceEqualityComparer instance.

public bool Equals(object x, object y)

Determines whether two object references refer to the same object instance.

public int GetHashCode(object obj)

Returns a hash code for the specified object. The returned hash code is based on the object identity, not on the contents of the object.