title: How can I convert a string[] into a dictionary<int, string> using a separate int[] as the key set?
body: <p>I know that Linq offers the <code>ToDictionary(key, value)</code> method, and I'm sure there's a way to be able to do what I'm trying to achieve but I can't quite figure it out.</p>
  
  <p>I have two arrays, the first being <code>conditionalIds</code>, which is simply an <code>int[]</code> that stores a number of Ids, the second array is a <code>string[]</code> called <code>conditionalAnswers</code>. I essentially want to combine and map these two arrays so that each of the Ids stores in conditionalIds maps to the correct answer.</p>
  
  <pre><code>var conditionalIds = _currentRuleSet.MultiConditionalQuestionIds;
  var conditionalAnswers = _currentRuleSet.MultiConditionalQuestionAnswers;
  var map = conditionalAnswers.ToDictionary(conditionalIds, x =&gt; x[]);
  </code></pre>
  
  <p>However I'm not sure how to structure the Linq query to achieve this. </p>