Record — immutable data type.
Record class:
1public record Person(string Name, int Age);2var person = new Person("Alice", 30);3var updated = person with { Age = 31 };
Record struct:
1public record struct Point(double X, double Y);
With expression:
1var p1 = new Point(1, 2);2var p2 = p1 with { X = 10 };
Features:
Key: Records for immutable data.