ObjectReferenceEqualityComparer

An IEqualityComparer that uses reference equality instead of value equality when comparing two object instances.

Declaration
public sealed class ObjectReferenceEqualityComparer : IEqualityComparer<object>, IEqualityComparer

Determines whether the specified object is equal to the current object.

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

Serves as the default hash function.

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.

Gets the Type of the current instance.

Creates a shallow copy of the current Object.

Returns a string that represents the current object.

This method has been backported from a future framework (.NET 5), to avoid possible conflicts the class name has been adjusted from ReferenceEqualityComparer.

Last updated