Records in C#
Notes
Use a record when it would be useful to be able to compare their properties’ values versus a class, where you would have to implement that comparison logic yourself — the default behavior of using == between two classes would just be comparing the references, not the values of anything within.
You get the benefit of passing by reference, but keep the ergonomics of comparing by value.