Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/262.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
C# LINQ延迟执行并在左外部联接中返回null_C#_Entity Framework_Orm_Entity Framework 4.1 - Fatal编程技术网

C# LINQ延迟执行并在左外部联接中返回null

C# LINQ延迟执行并在左外部联接中返回null,c#,entity-framework,orm,entity-framework-4.1,C#,Entity Framework,Orm,Entity Framework 4.1,我有两个问题,请看以下代码: var table1 = from a in test1 join b in test2 on a.column1 equals b.column1 into jo from jb in jo.DefaultIfEmpty() select new { col1 = jb == null ? <question 1> :

我有两个问题,请看以下代码:

var table1 = from a in test1
             join b in test2 on a.column1 equals b.column1 into jo
             from jb in jo.DefaultIfEmpty()
             select new
             {
                col1 = jb == null ? <question 1> : jb.column1
             }

var table2 = from a in test3
             join b in test4 on a.column1 equals b.column1 into jo
             from jb in jo.DefaultIfEmpty()
             select new
             {
                col1 = jb == null ? <question 1> : jb.column1
             }

var table3 = from x in table1
             join y in table2 on x.col1 equals y.col1 into jo
             from jb in jo.DefaultIfEmpty()
             {
                  col1 = jb == null ? <question 1> : jb.col1
             }

var table4 = from z in table1.Concat(table2)
             select new TheTables()
             {
                 column1 = x.col1
             }

第二个问题:根据我上面给出的代码,当我执行“table4.List()”时,它会以组合语句的形式查询数据库,还是会查询table1,然后查询table2,然后将其作为table3加入内存?

我想你的意思是从jb in jo.DefaultIfEmpty()哈哈哈,很抱歉我错过了这一点,谢谢你的提示。:)
The argument to DbIsNullExpression must refer to a primitive, enumeration or reference type.