Lina  Biyinzika

Lina Biyinzika

1620215100

C#9 - init-only properties are not read-only at runtime

C#9 adds the concept of init-only properties. These properties can be set when creating the object and become get only once object creation has been completed.

So, you may think the init-only properties can be considered read-only once the object is created. However, when using reflection, init-only properties look like any other property. They have a setter that you can call it as if the property were a { get; set; }.

#.net #c#9

C#9 - init-only properties are not read-only at runtime