age
is a method and you call it like a property.
Either do the following:
person.age(today, birthday);
or convert it to a property, which is probably what you want:
public int Age
{
get
{
var today = DateTime.Now;
if (today.Month < this.birthDate.Month)
{
return ((today.Year - this.birthDate.Year) - 1);
}
else if (today.Month == this.birthDate.Month )
{
if (today.Day >= this.birthDate.Day)
return (today.Year - this.birthDate.Year);
else
return ((today.Year - this.birthDate.Year) - 1);
}
else
return (today.Year - this.birthDate.Year);
}
}