Tag: Tuples

Using Tuples for Overriding Equality and GetHashCode

Overriding Objects The implementation of Equals() and GetHashCode() used to be complex, but with C# 7.0 Tuples, the actual code is boilerplate. For Equals(): It’s necessary to compare all the contained identifying data structures while avoiding infinite recursion or null reference exceptions. For GetHashCode(): It’s necessary to combine the unique hash code of each of […]