using System.ComponentModel; namespace MedicalDatabaseContracts.Models { public class Patient : AbstractPersonModel { public string Gender { get; set; } = string.Empty; public DateTime Birthday { get; set; } public int Weight { get; set; } public int Height { get; set; } public int GetAge() { var today = DateTime.Today; int age = today.Year - Birthday.Year; if (Birthday.Date > today.AddYears(-age)) age--; return age; } } }