Created
December 7, 2022 16:26
-
-
Save aemloviji/b97b53e28b968d468465ceb3976bede8 to your computer and use it in GitHub Desktop.
C# lowering record type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an instance of Device | |
var device1 = new Device("DELL", "f8078ddc-2d59-4902-9acd-8cd88649186d"); | |
// copy device1 with some modification using with expression | |
// to achive nondestructive mutation | |
var device2 = device1 with { Identifier = "aea8be94-788a-4b01-a569-9f496904a49c" }; | |
// Device record type definition | |
public record Device(string Manufacturer, string Identifier); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment