0

This is the query:

SELECT colA, colB, colC
FROM TableA 
LEFT JOIN TableB 
ON TableA.colA = tablea.colA
LEFT JOIN TableC 
ON TableA.colA = TableC.colA

This is my LINQ code:

from a in TableA
join b in TableB on a.colA equals b.colA 
join c in TableC on a.colA equals c.colA 
select new { values here}

but it doesn't seem to work.

Here is the exact schema we will be using

Justin
  • 11
  • 4

1 Answers1

0

try this

data= (from a in TableA
join b in TableB on a.colA equals b.colA into bj
 from b in bj.DefaultIfEmpty()
join c in TableC on a.colA equals c.colA  into cj
 from c in cj.DefaultIfEmpty()
select new { a.Cola,b.Colb, c.Colc}).ToList();
Serge
  • 40,935
  • 4
  • 18
  • 45