title: Linq Query Dictionary where value in List
body: <p>I have a <code>Dictionary&lt;string, string&gt;</code> and another <code>List&lt;string&gt;</code>. What I am trying to achieve is a linq query to get all items out of the dictionary where any values from said dictionary are in the <code>List&lt;string&gt;</code>. </p>
  
  <p>I found this post to be helpful, <a href="https://stackoverflow.com/questions/12114227/linq-querying-a-dictionary-against-a-list">LINQ querying a Dictionary against a List</a> . And was able to write the following linq expression, however my results never actually return anything. </p>
  
  <p>What I have so far. </p>
  
  <p><code>Data</code> is the dictionary and <code>PersonList</code> is the list of strings.</p>
  
  <pre><code>var Persons = PersonList.Where(x =&gt; Data.ContainsKey(x))
                          .Select(z =&gt; new { key = z, value = Data[z] })
                          .ToList();
  </code></pre>