.NET & C# ยท C#
When should you use records and immutability in C#?
Use records for data-centric models where identity is defined mainly by values. Use classes when object identity and mutable lifecycle behavior are more important.
Use records for data-centric models where identity is defined mainly by values. Use classes when object identity and mutable lifecycle behavior are more important.