Auto-properties can be public read, private set. So really, it looks like:<p><pre><code> namespace MyCompany.MyProduct
{
public class Person
{
public Person(string name, int age)
{
Name = name;
Age = age;
}
public string Name { get; private set; }
public int Age { get; private set; }
}
}
</code></pre>
I suppose it's not <i>technically</i> immutable, but you can just refrain from setting anywhere else inside the class.