title: c# get value subset from dictionary by keylist
body: <p>Ok, so you can get a single value by <code>dictionary[key]</code> or all values by <code>dictionary.Values</code>.</p>
  
  <p>What I am looking for is a way to get all values for a given key set like so:</p>
  
  <pre><code>List&lt;string&gt; keys;
  Dictionary&lt;string, object&gt; dictionary;
  
  List&lt;object&gt; valuesForKeys = GetValuesFromDictionaryUsingKeys(dictionary, keys);
  </code></pre>
  
  <p>with</p>
  
  <pre><code>private List&lt;object&gt; GetValuesFromDictionaryUsingKeys(Dictionary&lt;string, object&gt; dictionary, List&lt;string&gt; keys)
  {
      //your code here
  }
  </code></pre>
  
  <p>Of course I could iterate manually over the keylist and use <code>dictionary[key]</code> each time and add all the values back to a list again, but I would like to use some more elegant way (e.g. Linq).</p>
  
  <p>Thanks.</p>