title: Left join with group by linq lambda expression c#?
body: <p>I want to write left join using linq lambda expression. I have tried query using join but now I want to create using left join so any one can help me how can do.</p>
  
  <p>Here this is my query:</p>
  
  <pre><code>var UserList = db.UserInfo
                  .Join(db.Course, u =&gt; u.id, c =&gt; c.userid, (u, c) =&gt;
                  new { u, c }).GroupBy(r =&gt; r.u.id)
                  .Select(g =&gt; g.OrderByDescending(r =&gt; r.c.datetime)
                  .FirstOrDefault()).OrderByDescending(a =&gt; a.u.datetime).ToList();
  </code></pre>
  
  <p>Using this query, I don't want user data those who are not in course table, so I want to this data also in course table in userid in or not.</p>