Understanding IEquatable

  1. From MS Docs article on IEquatable<T>:

    If you implement IEquatable<T>, you should also override the
    base class implementations of
    Equals(Object) and
    GetHashCode() so that their behavior is
    consistent with that of the
    Equals(T)
    method. If you do override
    Equals(Object), your
    overridden implementation is also
    called in calls to the static
    Equals(Object, Object)
    method on your class. In addition,
    you should overload the op_Equality
    and op_Inequality operators.
    This ensures that all tests for equality
    return consistent results.

  2. No, operators do not use the Equals method. They must be overloaded separately to do so.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)