with expression
Copying a record while changing a few properties.
A with expression creates a shallow copy of a record or struct with specified properties changed (nondestructive mutation).
Loading interactive…
Examples
var moved = home with { City = "Porto" };copieshomewith a new city and leaveshomealone.