LINQ Left Outer Join

Linq Left Outer Join

var result = from a in dc.TABLEA.ToList()
join b in dc.TABLEB
on a.Title equals b.Title
into joined
from b in joined.DefaultIfEmpty()
select new
headline = (b == null ? string.Empty : b.Headline),
content = (b == null ? string.Empty : b.Description)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s