title: Issue with many-to-many query with linq to entities
body: <p>I've got a table </p>
  
  <p><strong>Application</strong></p>
  
  <pre><code>ApplicationID,
  NAme
  </code></pre>
  
  <p><strong>ApplicationSteps</strong></p>
  
  <pre><code>AplicationStepID,
  AplicationID,
  StepID
  </code></pre>
  
  <p><strong>ApplicationStepCriterias</strong></p>
  
  <pre><code>ApplicationStepID,
  CriteriaID
  </code></pre>
  
  <p>So I've got one <code>SelectedCriteriaID</code> - a user choose from a dropdown one criteria and he wants all the applications which has this <code>SelectedCriteriaID</code> in the table <code>ApplicationStepCriterias</code></p>
  
  <p>I tried</p>
  
  <pre><code> var ds = context.Applications
                     .Where(a =&gt; a.ApplicationSteps
                                    .Select(x=&gt;x.ApplicationStepCriterias
                                                   .Select(t=&gt;t.CriteriaId))
                                    .Contains(SelectesdCriteria));
  </code></pre>
  
  <p>But as I have as result <code>IEnumerable&lt;IEnumerable&lt;int&gt;&gt;</code> I cannot use Contains 
  Just I get a list of all the <code>CriteriaId</code>s for each <code>ApplicationStep</code>(also a sequence).  Just I cannot think of  way to get in one list all the <code>CriteriId</code>s.</p>