In C# 3.0, I'm doing the code below to declare a DateTime property and a int age property that is read only.
public class MyClass{
public DateTime dateOfBirth{ get; set; }
public int age { get; }
public MyClass(){}
public int CalculateAge(){}
}
But how can I get this updated age (that it's read only) when someone enters his date of birth in a form, for example?