I have a LINQ statement where I am joining on an ID field. The problem is that sometimes the ID on the left of the "equals" may be null.
Is there any way to handle this?
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};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With