title: Select many rows from a data store using Linq to Entities
body: <p>We need to accept a collection of key values from user input. Then a query must be performed on a L2E data store which shall select all rows whose keys are included in the collection. The best I've got so far is:</p>
  
  <pre><code>var lines = dataStore.Entities.ToList(); /* To List to force a query */
  var selectedLines = lines.Where(line=&gt; inputValues.Contains(line.key)).Distinct();
  </code></pre>
  
  <p>However, this seems seems wasteful since we're pulling the entire data store in order to select (probably) just a small number of rows. Would it be less wasteful to execute a separate query matching each key value (the column is indexed) or is there a better way with Linq syntax that I've missed?</p>