Sometimes when working with C# you discover some hidden gems. Some of them very useful, other ones a little bit harder to find a good way to benefit from their functionality. One of those hidden gems that I discovered some days ago is the PrintMembers method. Record Types To explain where you can find this method, I first have to talk about record types . Record types were introduced in C# 9 as a new reference type that you can create instead of classes or structs. C# 10 adds record structs so that you can define records as value types. Records are distinct from classes in that record types use value-based equality . Two variables of a record type are equal if the record type definitions are identical, and if for every field, the values in both records are equal. Record types have a compiler-generated ToString method that displays the names and values of public properties and fields: Person{ FirstName = Bart, LastName = Wullems } In an application we are building w...