我需要帮助才能将此表达式转换为LINQ。 在这个例子中:
TableA[IDTABLE_A, NAME]
TableA[IDTABLE_B, IDTABLE_A, REL]
SELECT *
FROM TableA a
LEFT JOIN TableB b
ON a.IDTABLE_A = b.IDTABLE_A
AND b.IDTABLE_B = 3
提前致谢。
答案 0 :(得分:1)
试试这个: -
var query = from a in data1
join b in data2.Where(x => x.BID == 3)
on a.AID equals b.AID into ab
from c in ab.DefaultIfEmpty()
select new
{
AID = a.AID,
AName = a.AName,
BName = c == null ? "No Records" : c.BName
};
完成工作小提琴Here。