LINQ在条件为“或”的情况下左联接

时间:2019-02-13 15:00:10

标签: linq

我想用linq编写此查询。请帮忙!!!

select  * from TableA a
join Table B b
on a.ID = b.ID
left join TableC c
on b.ID=c.ID or b.ID = c.Text

1 个答案:

答案 0 :(得分:0)

  

您不需要总是加入。

  var result =  from a in TableA
  from b in TableB
  from c in TableC
  where a.ID == b.ID && b.ID = c.ID || b.ID == c.Text