Left Join using linq in telerik entity framework

var result = from p in _context.ParentTable
join c1 in _context.ChildTable1
on p.ID equals c1.ID into pc1Table
from pc1Join in pc1Table.DefaultIfEmpty()
join c2 in _context.ChildTable2 on p.ID equals c2.ID into pc2Table from pc2Join in pc2Table.DefaultIfEmpty()
where (c1.columnname == "value1" ||
c2.columnname == "value2") && p.columnname == "value"
select new
{
pID = p.ID,
c1ID = c1.ID,
c2ID = c2.ID};

Comments

  1. greattt, finally i got answer from here, keep up the good work

    ReplyDelete

Post a Comment

Popular posts from this blog

storing byte array as column value in datatable using c#

post form data and bind with model : using jquery ajax in mvc

Htc sensation XL mobile not working with windows 7 or above, along with Htc sync software