LINQ Join语句可能带有NULL id?

Jam*_*ght 3 linq null

我有一个LINQ语句,我正在加入ID字段.问题是有时"等于"左侧的ID可能为空.
有办法处理这个吗?

Amy*_*y B 6

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};
Run Code Online (Sandbox Code Playgroud)