I'm having trouble understanding how to initialize a C# record using named parameters.. This obviously works with more traditional classes with get; set; (or init) properties. Am I missing some special syntax? The reason it matters is that I prefer this kind of initialization to make the code more readable. Thank you
public record Person(string Name, int Age, double Income);
//this does not work
var p = new Person { Name = "Tim", Age = 40, Income = 55 };
var p = new Person(Name : "Tim", Age : 40, Income : 55 );
– Superhuman