连接子句中的一个表达式的类型不正确。类型推断在调用组Join时失败

时间:2015-09-22 15:44:44

标签: linq linq-to-sql

请查看我的Linq查询并提出修复建议。第二次加入是错误的。

 var result = (from e in _DB_Goal_Allocation.Employees.Where(x => x.Active == 1 && x.Branch_Number == ddlBranch)
                          join j in _DB_Goal_Allocation.Employees_JobTitleGroupLOBs.Where(y => Job_Group.Contains(y.JobGroup)) on e.Title equals j.JobTitle
                          join g in _DB_Goal_Allocation.Goal_Allocation_Employees.Where(ga => ga.Year == ddlYear)
                          on new{ e.Branch_Number, e.EmployeeID } equals new { Branch_Number = g.BranchNumber, EmployeeID = g.EmployeeID } into emp
                          from t in emp.DefaultIfEmpty()
                          select e.FirstName + " " + e.LastName as EmployeeName).ToList();

0 个答案:

没有答案