-
Course
- Core Tech
C# 5 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.
What you'll learn
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.
Table of contents
- Version Check | 20s
- Welcome and Course Overview | 3m 58s
- Aims of This Course | 1m 53s
- So Why Is Equality Hard? | 1m 49s
- Reference vs. Value Equality | 3m 38s
- Equality, Value Types, and Boxing | 3m 13s
- Multiple Ways to Compare Values | 3m 38s
- 'Natural' vs. 'Plugged-In' Equality | 2m 49s
- Equality for Floating Points | 2m 57s
- The Equality/OOP/Type-Safety Conflict | 2m 56s
- Summary | 1m 16s
- Overview | 1m 28s
- The Virtual Object.Equals() Method | 5m
- Equals() for Strings | 2m 31s
- Equals() for Value Types | 3m 36s
- Object.Equals() - Review | 1m 31s
- The Static Equals() Method | 3m 28s
- The ReferenceEquals() Method | 1m 29s
- Introducing IEquatable<T> | 3m 6s
- IEquatable<int> Demo | 1m 50s
- IEquatable<T>, Strings and Reference Types | 1m 44s
- Summary | 1m 33s
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 Courses by Simon