Q : "Can model classes contain methods and constructor?" [BEST PRACTICE]
I have a class of employees, which consists of the name of the employee, age, salary, etc.
public class Employee
{
public string Name { get; set; }
public int Age { get; set; }
public int Salary { get; set; }
}
can the above Model Classcontain some self-updating methods (for example, update the employee’s age every 1 hour with a timer or something] and / or constructors, or is it better to handle all these things from the executor?
source
share