Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linq中带连接的多个条件_Linq_Entity Framework - Fatal编程技术网

Linq中带连接的多个条件

Linq中带连接的多个条件,linq,entity-framework,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 eq

对于下面的代码,它给出了错误

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 };

完整的错误消息将有助于在第4条join语句中显示错误。与多个条件比较,其中一个属性(BookNumber,Id)可为null,而匹配的属性不可为null?将设置peoperties,并且在执行join或PROJECTION时将忽略不可为null的
Include
语句