title: Join table with object list
body: <p>I have a table, lets say tblCar with all the related columns like Id, Make, Model, Color etc.</p>
  
  <p>I have a search model for car containing two params Id and Model.</p>
  
  <pre><code>public class CarSearch
  {
     public int Id { get; set; }
     public string Model { get; set; }
  }
  
  var carSearchObjets = new List&lt;CarSearch&gt;();
  </code></pre>
  
  <p>With list of primitive data (like Id list), to get cars with those Ids I could have done:</p>
  
  <pre><code>var idList = new List&lt;int&gt; { 1, 2, 3 };
  var carsFromQuery = context.Cars.Where(x =&gt; idList.Contains(x.Id);
  </code></pre>
  
  <p>But if I have to fetch all the cars with Id and model from the list, how do I do it? Simple join cannot be done between in memory objects and tables.</p>
  
  <p>I need something like,</p>
  
  <pre><code>from m in context.Cars
  join n in carSearchObjets 
       on new { Id = n.Id, Model = n.Model } equals new { Id = m.Id, Model = m.Model }
  select m;
  </code></pre>
  
  <p>This obviously won't work.</p>
  
  <p>Please ignore any typos.And if you need more info or the question is not clear, let me know. </p>