Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
C#

Records in C#

Model immutable data with record / record struct.

Records in C# — a practical guide to C# records with clear examples you can reuse in real projects.

C# Tutorial Series (69/121). Prefer one article? Read the complete C# tutorial.

Short description

Records give value-based equality and with-expressions.

Record

record User(string Id, string Email);
var u2 = u1 with { Email = "new@example.com" };

Leave a reply

Your email address will not be published. Required fields are marked *