我有以下 Linq 查询,我想根据以下条件对小时数WorkItem.Id
求和:
EntryCategories
.Join(TimeReportEntries,
ec => ec.Id,
tr => tr.WorkItem.Id,
(ec, tr) => new { ec, tr })
.Join(Timesheets,
ecs => ecs.tr.Timesheet.Id,
t => t.Id,
(ecs, t) => new { ecs, t })
.Join(Users,
ts => ts.t.User.Id,
u => u.Id,
(ts, u) => new
{
Employee = ts.t.User.FirstName + " " + ts.t.User.LastName,
Hours = ts.ecs.tr.Hours
});