C# Equality and Comparisons

This course teaches you how equality and comparisons function in .NET and the correct way to implement equality and comparisons for your own types.
Course info
Rating
(621)
Level
Intermediate
Updated
Sep 10, 2014
Duration
4h 50m
Table of contents
Why Is Equality So Hard?
Equality in .NET
The C# Equality Operator
Implementing Equality for Value Types
Implementing Equality for Reference Types
Comparisons in .NET
Equality and Comparisons for Strings
Comparers and Equality Comparers
Hash Codes and Hashtables
Structural Equality and Comparisons
Description
Course info
Rating
(621)
Level
Intermediate
Updated
Sep 10, 2014
Duration
4h 50m
Description

In this course, you'll learn how to use equality and comparisons correctly in your C# code: both how they work out of the box, and how to implement equality and comparisons for your own types. The course also covers working with inheritance, string comparisons, writing custom comparers and equality comparers, hash codes, and structural comparisons.

About the author
About the author

Simon is a senior developer with over 20 years programming experience, particularly covering C++ and the .NET Framework. He believes knowledge is to be shared and has written or co-written more than a dozen books for professional programmers.

More from the author
C# Concurrent Collections
Advanced
2h 42m
Jul 31, 2020
Advanced C# Collections
Intermediate
3h 46m
Jan 9, 2020
Beginning C# Collections
Beginner
3h 25m
Mar 29, 2019
More courses by Simon Robinson