title: Filter IEnumerable<T> against IEnumerable<string>
body: <p>I have an object <code>Style</code> with a property <code>StockNumber</code>. I would like to filter a list of all <code>Db.Styles</code> against an <code>IEnumerable&lt;string&gt; stockNumbers</code> the user enters in a search. <code>DB.Styles</code> is an <code>IEnumerable&lt;Style&gt;</code>. Here is essentially what I am trying to do:</p>
  
  <pre><code>public IEnumerable&lt;Style&gt; LoadListOfStyles(IEnumerable&lt;string&gt; stockNumbers)
  {
      return Db.Styles.Intersect(stockNumbers);
      // Need to filter Db.Styles based on stockNumbers
  }
  </code></pre>
  
  <p>So is there an easy way to compare the list of all styles in <code>Db.Styles</code> against my search values in <code>stockNumbers</code> to return a filtered list of only the <code>Styles</code> the user has searched for? The only way I have seen to be able to do this is to have 2 IEnumerable objects to intersect, but loading the styles one by one from the stock numbers searched seems like a lot of unnecessary code. I am wondering if there is an easier way. Or do I need to roll my own method to filter the results?</p>