Hello
I want to write left join by linq and fill a view by out but of this left join.
my left join is like below
select table1.a, table1.b,table2.c
from table1 left join table2
on table1.a=table2.c
where table2.g="123" or table2.g==null
as I said want to put output of this join to a view.
Thanks for your help.

Jignesh TrivediRank #16 · 50.3K reputationPosted May 20, 2014, 2:34 AM EDT
try ...
var k = from t1 in db.table1
join t2 in db.table2 on new { a=t1.a } equals new {a=t2.c} into p
from l in p.DefaultIfEmpty()
where l.g == "123" || l.g ==null
select new {t1.a, t1.b,t2.c }
hope this will help you.
Khan Abrar AhmedRank #778 · 3K reputationPosted May 20, 2014, 2:38 AM EDT
http://msdn.microsoft.com/en-us/library/bb311040.aspx
Yadlapalli SrikanthRank #7,940 · 231 reputationPosted May 20, 2014, 2:59 AM EDT
http://www.dotnet-tricks.com/Tutorial/linq/UXPF181012-SQL-Joins-with-C