score:1

Accepted answer

Something like this maybe:

var listC = (
                from hb in holdBilling
                from p in payer.Where(a=>a.payerID==hb.payerID).DefaultIfEmpty()
                from c in carrier.Where(a=>a.carrierID=hb.carrierID).DefaultIfEmpty()
                where hb.bEntityID==378
                select new
                {
                    hb.bEntityID,
                    c.carrierID,
                    c.carrierName,
                    p.payerID,
                    p.payerName,
                    holdType=(payer==null?"P":"C")
                }
                ).Take(1000)
                .ToList();

score:1

You need to use DefaultIfEmpty to do a left join

 var listC = (from hold in holdBilling
              from u in Users.Where(x => hold.createUserID == x.userID).DefaultIfEmpty()
              from c in carrier.Where(x => hold.carrierID == x.carrierID).DefaultIfEmpty()
              select new
              {
                Elem = hold,
                FName = u.userFirstName,
                LName = u.userLastName,
                Carrier = c.carrierName,
                Payer = ""
              }).ToList();

Related Articles