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
(610)
Level
Intermediate
Updated
Sep 10, 2014
Duration
4h 51m
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
(610)
Level
Intermediate
Updated
Sep 10, 2014
Duration
4h 51m
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
Beginning C# Collections
Beginner
3h 26m
Mar 29, 2019
C# Concurrent Collections
Advanced
3h 32m
May 15, 2015
More courses by Simon Robinson