title: LINQ Any() not working as expected
body: <p>I'm battling with what I thought would be a simple query...</p>
  
  <p><strong>Schema is like</strong>:</p>
  
  <p><code>Documents</code> (DocumentID, Name)<br />
  <code>Industries</code> (IndustryID, Name)<br />
  <code>Documents_Industries</code> (DocumentID, IndustryID)</p>
  
  <p><strong>Data is like</strong>:</p>
  
  <p>DocA -- IndustryA<br />
  DocB -- IndustryA, IndustryB<br />
  DocC -- IndustryA, IndustryB<br />
  DocD -- IndustryB</p>
  
  <p>(So the data above would result in 6 rows in <code>Documents_Industries</code>, hopefully that's self-explanatory)</p>
  
  <p><strong>Expected behaviour</strong>: I'm trying to show a list of Documents, filtered by the Industry(ies) a user selects. If IndustryA is selected, result set should be DocA, DocB, DocC. If IndustryB is selected, result set should be DocB, DocC, DocD. <strong>If IndustryA and IndustryB is selected, result set should be DocB, DocC.</strong></p>
  
  <p><strong>Code so far</strong>:</p>
  
  <pre><code>IEnumerable&lt;Document&gt; docs = db.Documents.Where(l =&gt; l.IsActive == true);
  
  // industryIdsSelected is an int[] from the user's selection
  
  if (industryIdsSelected.Length &gt; 0)
  {
      docs = docs.Where(l =&gt; l.Industries.Any(m =&gt; industryIdsSelected.Contains(m.IndustryID)));
  }
  </code></pre>
  
  <p><strong>Actual behaviour</strong>: If IndustryA and IndustryB is selected, result set is DocA, DocB, DocC, DocD. Instead of just DocB, DocC.</p>
  
  <p>I've tried with <code>.All()</code> but that doesn't work either. What could I be doing wrong?</p>