Lecture overview -- Keyboard shortcut: 'u'  Previous page: Generic interfaces: IComparable<T> -- Keyboard shortcut: 'p'  Next page: Generic Classes and Inheritance -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Generic Types and Methods - slide 15 : 21

Generic equality interfaces

The generic interface IEquatable<T> prescribes an Equals operation, and as such it is more fundamental than the interface IComparable<T>.

The generic interface IEqualityComparer<T> prescribes both Equals and GetHashCode.

IEquatable.cs
A reproduction of the generic interface IEquatable<T>.
IEqualityComparer.cs
A reproduction of the generic interface IEqualityComparer<T>.