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

猜你喜欢

转载自www.cnblogs.com/GiserPage/p/11438621.html
今日推荐