AreEqual Method
Definition
AreEqual<T>(T, T)
Determines whether the two specified x and y are equal by using the default equality operator from T.
public static bool AreEqual<T>(T x, T y)
Parameters
xTThe first object to compare.
yTThe second object to compare.
Returns
- bool
trueifxare equal toy; otherwisefalse.
Type Parameters
TThe type of objects to compare.
AreEqual<T>(T, T, IEqualityComparer<T>)
Determines whether the two specified x and y are equal by using the equality operator.
public static bool AreEqual<T>(T x, T y, IEqualityComparer<T> comparer)
Parameters
xTThe first object to compare.
yTThe second object to compare.
comparerIEqualityComparer<T>The IEqualityComparer<T> implementation to use when comparing
xandy.
Returns
- bool
trueifxare equal toy; otherwisefalse.
Type Parameters
TThe type of objects to compare.
Exceptions
- ArgumentNullException
compareris null.