title: Linq left joining 3 tables
body: <p>I'm trying to translate following query to lambda expression</p>
  
  <pre><code>var results = (from g in _groups
           join cr in _categoryRoots on g.Id equals cr.Group_Id into gcr
           from lgc in gcr.DefaultIfEmpty(new CategoryRoot())
           join c in _categories on lgc.Id equals c.CategoryRoot_Id into ccr
           from lccr in ccr.DefaultIfEmpty()
           select new GroupCategory
           {
               Id = g.Id,
               Name = g.Name,
               CategoryRoot_Id = lgc == null ? 0: lgc.Id,
               CategoryRootName = lgc == null ? "": lgc.Name,
               Category_Id = lccr == null ? 0: lccr.Id,
               CategoryName = lccr == null ? "": lccr.Name
           }).ToList();
  </code></pre>
  
  <p>Want to change in to something like below.</p>
  
  <pre><code>var rs = _groups.Join(_categoryRoots, g =&gt; g.Id, cr =&gt; cr.Group_Id, (g, cr) =&gt; new GroupCategory { Id = g.Id, Name = g.Name, CategoryRoot_Id = cr.Id, CategoryRootName = cr.Name  });
  </code></pre>
  
  <p>running code example <a href="https://dotnetfiddle.net/A3AO0V" rel="nofollow noreferrer">https://dotnetfiddle.net/A3AO0V</a></p>