EqualityComparer<T>.IEqualityComparer.Equals(Object, Object) Method

Definition

Determines whether the specified objects are equal.

 virtual bool System.Collections.IEqualityComparer.Equals(System::Object ^ x, System::Object ^ y) = System::Collections::IEqualityComparer::Equals;
bool IEqualityComparer.Equals (object x, object y);
abstract member System.Collections.IEqualityComparer.Equals : obj * obj -> bool
override this.System.Collections.IEqualityComparer.Equals : obj * obj -> bool
Function Equals (x As Object, y As Object) As Boolean Implements IEqualityComparer.Equals

Parameters

x
Object

The first object to compare.

y
Object

The second object to compare.

Returns

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

Implements

Exceptions

x or y is of a type that cannot be cast to type T.

Remarks

This method is a wrapper for the Equals(T, T) method, so obj must be cast to the type specified by the generic argument T of the current instance. If it cannot be cast to T, an ArgumentException is thrown.

Comparing null is allowed and does not generate an exception.

Applies to