Click here to Skip to main content
15,886,258 members
Articles / Programming Languages / C# 7.0

Overriding Equals and GetHashCode Laconically in C#

Rate me:
Please Sign up or sign in to vote.
4.80/5 (14 votes)
9 Aug 2018CPOL3 min read 32.3K   11  
In this article, we'll consider overriding the Equals and GetHashCode methods, why IEquatable interface is useful and how Tuples introduced in C# 7.0 can make our implementation laconic.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
I, Nick, am a Senior Software Engineer and Microsoft Certified Database professional (MCSA) who is passionate about the development of high-quality software, troubleshooting, optimization, Business Intelligence solutions and databases. I’ve been writing software in financial, staffing, consulting, educational, pharmaceutical and other industries.

Comments and Discussions