我有一个LINQ语句,其中我要在ID字段上进行连接。问题是左边的ID有时可能为空。
有没有办法处理这种情况?
我有一个LINQ语句,其中我要在ID字段上进行连接。问题是左边的ID有时可能为空。
有没有办法处理这种情况?
from x in left
where x.Id != null
join y in right on x.Id equals y.Id into rightMatches
from y2 in rightMatches.DefaultIfEmpty() //in your comments you said LEFT JOIN
select new {x, y2};