Created
December 23, 2020 14:30
-
-
Save crgrieve/b896203d1363108937a5d94c6cdb5480 to your computer and use it in GitHub Desktop.
C# 9 init only properties
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
using System; | |
var glasgowMeetup = new Meetup() { | |
City ="Glasgow", | |
Topic = ".Net" | |
}; | |
Console.WriteLine(glasgowMeetup); | |
public record Meetup | |
{ | |
public string City { get; init; } | |
public string Topic { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment