title: using let keyword in linq to combine queries
body: <p>I'm writing a query that returns a list of models that needs data from two tables and I'm hoping the <code>let</code> keyword can help me. I'm starting like this:</p>
  
  <pre><code>var TheListOfModels = 
                  let Data1 = (from a in MyDC.Table1
                                where ....
                                select new ObjectThatContainsData1()
                                {
  
                                }).ToList()
  
                  let Data2  = (from b in MyDC.Table2
                                where ....
                                select new ObjectThatContainsData2()
                                {
  
                                }).Tolist()                 
  
                  select new ObjectThatContainsBothData()
                  { 
                       SomeProp1 = from p in Data1
                                   select everything
  
                       SomeProp2 = from a in Data2
                                   select everything
  
                  }).ToList()
  </code></pre>
  
  <p>I'm not too sure on how to proceed and write the final <code>select</code> statement that selects from the result of the 2 <code>let</code> clauses rather than directly from tables. Is the structure of the query I'm writing a good starting point or should I write it another way?</p>
  
  <p>Thanks.</p>
  
  <p>Edit per comment: table definitions</p>
  
  <p>Table1 looks somewhat like this:</p>
  
  <pre><code>PeachID | UserID | HarvestDateTime | SomeOtherColumn
  </code></pre>
  
  <p>Table2 looks like that:</p>
  
  <pre><code>AppleID | UserID | HarvestDateTime | SomeOtherColumn
  </code></pre>
  
  <p>I'm looking to extract all the peaches and apples into a list of the <code>ObjectThatContainsBothData</code> and the where clause is basically there to filter the <code>HarvestDateTime</code> and the <code>UserID</code></p>