Custom Equality check for C# 9 records
问题 From what I understand, records are actually classes that implement their own equality check in a way that your object is value-driven and not reference driven. In short, for the record Foo that is implemented like so: var foo = new Foo { Value = "foo" } and var bar = new Foo { Value = "foo" } , the foo == bar expression will result in True , even though they have a different reference ( ReferenceEquals(foo, bar) // False ). Now with records, even though that in the article posted in .Net