I need to define these two Properties to one of my linqclasses (Employee).. because I need to keep track of the health progress of Employees... Each employee takes monthly PhysicalExams so I defined these properties
public decimal? Initial_Mass_Index
{
get
{
return this.PhysicalExams.OrderBy(p => p.Date).First().MassIndex ?? 0;
}
}
public decimal? Current_Mass_Index
{
get
{
return this.PhysicalExams.OrderByDescending(p => p.Date).First().MassIndex ?? 0;
}
}
My question is.. my app is using the Repository Pattern and I have read that it is not proper practice to have Data Access inside the Model Classes...
What do you guys reccomend?? please help thanks in advance