Aren't records meant to be immutable?
I don't understand why properties have setters in the generated definition of the record. I'm missing something.
I don't understand why properties have setters in the generated definition of the record. I'm missing something.
public int MyProp { get; init; }
instead of public int MyProp { get; set; }
Apparently those are implemented using readonly backing fields while still retaining property setters.