title: Lambda to turn IDictionary<string,object> values into object[]
body: <p>I am trying to create a Lambda expressions that creates an object array from an IDictionary based on given named input.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>var dic = new Dictionary&lt;string, object&gt;() 
          { 
              {"some", "value"}, 
              {"dateTime", DateTime.Now},
              {"someNum", 52},
              {"other", "values"}
          };
  
  string[] inputArray = { "input", "dateTime", "someNume" };
  
  var processedArray = inputArray.Select(i =&gt; dic.Where(d =&gt; d.Key == i).Select(kvp =&gt; kvp.Value)).ToArray();
  </code></pre>
  
  <p>This doesn't work, it returns an <code>IEnumerable&lt;object&gt;</code> but all the members are type <code>KeyValuePair&lt;string,object&gt;</code> just, it appears, without the key data.</p>
  
  <p>I think there are a few things wrong with this. I don't think I should be using <code>dic.Select()</code> as key entries in dictionary are unique and I am obviously referencing the value wrong or missing a way to cast each result. </p>
  
  <p>I am not sure how to achieve this using a single Lambda.  I need to work out the Lambda as I plan to use it as a compiled Lambda.</p>
  
  <p>Can someone advise me on how best to do this?</p>