使用多个表的连接查询在linq中进行排序

时间:2014-01-24 06:25:58

标签: c# linq linq-to-entities

我有以下表格,

1。 EmpRegDet

2。 EmpPlan

第3。警报

我的代码

return (from job in _db.Jobs
        join employerregdetails in _db.EmployerRegistrationDetails on job.OrganizationId equals employerregdetails.EmployerId into e
        join ep in _db.EmployerPlans on **emp.PlanId** equals ep.EmployerPlanId
        join alr in _db.AlertsDones on ep.Alerts equals alr.AlertsSent
        from emp in e.DefaultIfEmpty()
        orderby job.OrganizationId != -1 descending, job.OrganizationId != null descending
        orderby job.OrganizationId != -1 descending, emp.EmployerId == job.OrganizationId descending, job.CreatedDate descending
        select job);

我发现错误emp.planId。怎么检查这个?请帮帮我..

0 个答案:

没有答案