with expression

C# syntax that copies a record and changes only the members you name, as in kettle with { Name = "Teapot" }.

In more detail

It also works on structs and anonymous types. The original is left untouched, which is how you "change" immutable data.

Related terms

Taught in

References