Linq to Sql multiple outer joins

This should work:

var ans = from lbi in lbContext.lb_item
          where lbi.itemID == id
          join lbp in lbContext.lb_pattern on lbi.patternID equals lbp.patternID into lbpj
          from lbp in lbpj.DefaultIfEmpty()
          join lba in lbContext.lb_animal on lbi.itemID equals lba.itemID into lbaj
          from lba in lbaj.DefaultIfEmpty()
          join lbc in lbContext.lb_category on lbi.categoryID equals lbc.categoryID
          select new {

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top