title: Using Linq Lambda Nested Expression to join two lists
body: <p>I have the following code:</p>
  
  <pre><code>        List&lt;MyClass&gt; list1 = GetList1Contents();
          List&lt;MyClass&gt; list2 = GetList2Contents();
  
          foreach (MyClass eachClass in list1)
          {
              List&lt;MyClass&gt; results = (list2.Select(x =&gt; x.History.Select(z =&gt; (z.Key == eachClass.ID))));
          }
  </code></pre>
  
  <p>MyClass contains a List called History.  What I’m trying to do is match any entries in list2 that have history entries in list 1 – but the compiler doesn’t like my syntax.</p>