EqualityComparer<T>.IEqualityComparer.Equals Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Determines whether the specified objects are equal.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- x
- Type: System.Object
The first object to compare.
- y
- Type: System.Object
The second object to compare.
Implements
IEqualityComparer.Equals(Object, Object)| Exception | Condition |
|---|---|
| ArgumentException | x or y is of a type that cannot be cast to type T. |
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.