When to use record vs class vs struct
Short version Can your data type be a value type? Go with struct. No? Does your type describe a value-like, preferably immutable state? Go with record. Use class otherwise. So… Yes, use records for your DTOs if it is one way flow. Yes, immutable request bindings are an ideal user case for a record Yes, … Read more