我需要將這兩個屬性定義到我的linqclasses(Employee)之一..因爲我需要跟蹤Employees的健康進度...每個員工都需要每月進行一次PhysicalExams,因此我定義了這些性能幫助將屬性添加到LinqToSql類
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;
}
}
我的問題是..我的應用程序正在使用存儲庫模式,我已閱讀,這是不恰當的做法有示範類中數據訪問...
你們有什麼reccomend ?? 請幫助 在此先感謝