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则进行全盘扫描速度奇慢,如果单独为""则查询不出结果。

posted @ 2019-08-31 12:54  佩奇giser  阅读(1605)  评论(0编辑  收藏  举报