title: Where clause of LINQ statement to find instances of a string within a List<string> collection?
body: <p>I'm trying to construct a Where clause for a Linq statement which needs to determine whether the <strong>AccountNumber</strong> values retrieved as below exist in a <strong><code>List&lt;string&gt;</code></strong> collection.</p>
  
  <p>I've thus far tried this:</p>
  
  <pre><code>private void FindAccountNumbers(List&lt;string&gt; AccountNumbers)
  {
      var query = from abc 
      select new
      {
          AccountNumber = abc.AccountNumber
      };
  
      query = query.Where(AccountNumbers.Contains(x =&gt; x.AccountNumber));
  }
  </code></pre>
  
  <p>However I get the following build error:</p>
  
  <blockquote>
    <p>The type arguments for method
    'System.Linq.Queryable.Where(System.Linq.IQueryable,
    System.Linq.Expressions.Expression>)' cannot
    be inferred from the usage. Try specifying the type arguments
    explicitly.</p>
  </blockquote>
  
  <p>At runtime, <strong><code>query</code></strong> contains AccountNumber values, and I'm trying to pare this down based on matches found in the <code>AccountNumbers</code> collection (similar to an <strong>IN</strong> statement in TSQL). Should I be using <code>Intersect</code> instead of <code>Contains</code>? What am I doing wrong?? </p>