c# linq left join null值

from djb in djbEntity.Select(d => new { d.ZSLX, d.Id })
                              join fw in fwEntity.Select(d => new { d.SLBH })
                              on djb.Id equals fw.SLBH into fwtemp
                              from tt in fwtemp.DefaultIfEmpty()
                              where tt.SLBH == "" || tt.SLBH == null

where条件必须是""与null两个条件,如果单独为null则进行全盘扫描速度奇慢,如果单独为""则查询不出结果。

c# linq left join null值

上一篇:gradle clean can't delete file on Windows


下一篇:C# DataTable转List