C# Light Syntax
trelford.com
trelford.com
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; }
}
}
I suppose it's not technically immutable, but you can just refrain from setting anywhere else inside the class.