Linq中连接的多个条件

时间:2012-02-16 20:51:35

标签: linq entity-framework

对于以下代码,它会给出错误

type reference failed in the call to Join

如何解决这个问题

        var unp = from v in context.student.Include("subjects").Include("marks")
                  join n in context.AllStudents 
                    on v.StudentDetails.student_Id equals n.Id
                  join ss in context.StudentHistory 
                    on v.StBacklogs_Id equals ss.Id
                  join userName in context.Users 
                    on v.CreatedBy_Id equals userName.Id
                  join externalId in context.Books 
                    on new { ss.BookNumber, ss.Id } equals new { externalId.BookNumber, externalId.Id }                  
                  select new { v, n, ss, userName,externalId };

0 个答案:

没有答案