-2

我正在尝试从特定经理那里检索员工列表。我首先找到经理班次,然后找到该班次的经理列表。第三个查询需要检索属于该经理列表的所有员工。我不知道出了什么问题,但我没有得到任何结果。我感谢您的帮助

   //Determine shift of current user
    int shiftId = (from s in db.webpages_UsersInRoles
                   where s.UserId == userId
                   select s.ShiftId).Single();
    var ManagerId = (from g in db.tblManager
                      where g.ShiftId == shiftId
                      select g.UserID).ToList();

var employees = (from e in db.tblEmployee
                 where ManagerId.Contains(e.ShiftId.Value)                            
                 select e).ToList();
4

1 回答 1

0

您的最后一个查询是针对 e.ShiftId 检查应该针对 e.EmployeeId 的位置

var employees = (from e in db.tblEmployee
                 where ManagerId.Contains(e.EmployeeId.Value)                            
                 select e).ToList();
于 2013-09-18T07:42:51.123 回答