C# 14 · Records, classes and pattern matching

Copy a record with changes

Create a modified copy and leave the original unchanged.

var older = ada with { Age = 37 };

Official C# 14 documentation

More records, classes and pattern matching commands

All records, classes and pattern matching commands · C# 14 cheatsheet

Was this page helpful?