title: Establish a link between two lists in linq to entities where clause
body: <p>I'm pretty new to <code>Linq</code> and <code>EF</code> and I'm stuck regarding how I could just link two lists in Linq to Entities.</p>
  
  <p>I'm using Database First and I have two tables :</p>
  
  <p><code>Person</code>, with columns <code>Id</code><br>
  and<br>
  <code>Ability</code>, with columns <code>Id</code>, <code>PersonId</code> and <code>Value</code></p>
  
  <p>Thus, <code>Person</code> class has a <code>ICollection&lt;Ability&gt;</code>, called <code>AllAbilities</code>.</p>
  
  <p>In the ViewModel of some View, I get back a list of int, representing textboxes values entered by the user for <code>Ability.Value</code>, called <code>AbilitiesInput</code>.
  My need is simple, in the Controller I have to call a query which would do the following:</p>
  
  <pre><code>GetAll(person =&gt;
      for(i = 0; i &lt; AbilitiesCount; i++) { person.AllAbilities[i] &gt; AbilitiesInput[i] }
  )
  </code></pre>
  
  <p>Where <code>GetAll</code> method looks like that in my generic repo :</p>
  
  <pre><code>public virtual async Task&lt;List&lt;TEntity&gt;&gt; GetAll(
          Expression&lt;Func&lt;TEntity, bool&gt;&gt; wherePredicate = null
  { ... }
  </code></pre>
  
  <p>To resume, I just need a boolean which could check if every <code>AllAbilities[i]</code> is upper to <code>AbilitiesInput[i]</code>, but nothing I tried has worked.<br>
  I tried to change <code>AbilitiesInput</code> to <code>List&lt;KeyValuePair&gt;</code> or <code>List&lt;Tuple&gt;</code> but got an error saying that <code>No mapping exists</code>, tried to use a <code>Select</code> to create a new object, also tried to use <code>IndexOf</code> or <code>FindIndex</code> to get index without foreach...</p>
  
  <p>If anyone could explain me how I can achieve this simple thing I would be so, so glad.<br>
  Thanks a lot.</p>