title: Apply left join in 2 lists based on multiple conditions C#
body: <p>I have 2 data sets with me as follow :</p>
  <pre><code>{
          &quot;email&quot;: &quot;xyz@yopmail.com&quot;,
          &quot;courseId&quot;: &quot;111&quot;,
          &quot;courseName&quot;: &quot;Using Microsoft Azure Database Services&quot;,
          &quot;progress&quot;: 39,
          &quot;minutesWatched&quot;: 5.166667,
          &quot;lastActivity&quot;: &quot;2022-01-06T00:00:00Z&quot;
  } 
  </code></pre>
  <p>and</p>
  <pre><code>{
          &quot;email&quot;: &quot;xyz@yopmail.com&quot;,
          &quot;courseId&quot;: &quot;111&quot;,
          &quot;courseName&quot;: &quot;Using Microsoft Azure Database Services&quot;,
          &quot;startDate&quot;: &quot;2022-07-31T00:00:00Z&quot;,
          &quot;completeDate&quot;: null,
          &quot;completed&quot;: false
  }
  </code></pre>
  <p>I want to left join the two lists on the basis of emailId and courseId. From the first list I want to extart all the info and from the second I want to get the values for <code>completeDate</code> <code>completed</code> and <code>startedDate</code>. This is what I am using</p>
  <pre><code>var result = (from x in courseProgress
                            from y in courseCompletion
                                .Where(y =&gt; y.email.Equals(x.email, StringComparison.InvariantCultureIgnoreCase) &amp;&amp; y.courseId.Equals(x.courseId, StringComparison.InvariantCultureIgnoreCase))
                            select new XYZ
                            {
                                email = x.email,
                                courseId = x.courseId,
                                courseName = x.courseName,
                                progress = x.progress,
                                minutesWatched = x.minutesWatched,
                                startDate = y.startDate,
                                completeDate = y.completeDate.HasValue ? y.completeDate : DateTime.MinValue,
                                completed = y.completed,
                                lastActivity = x.lastActivity
                            }).ToList();
  </code></pre>
  <p>However, I want to apply a left join so that I can get records from first list even when there is no matching record from the second list.</p>