title: C# Linq Result ToDictionary Help
body: <p>I have a lambda expression that gets results from a Dictionary.</p>
  
  <pre><code>var sortedDict = (from entry in dctMetrics 
                    orderby entry.Value descending 
                    select entry);
  </code></pre>
  
  <p>The expression pulls back the pairs I need, I can see them in the IDE's debug mode.</p>
  
  <p>How do I convert this back a dictionary of the same type as the source? I know sortedDict's TElement is a KeyValuePair, but I am having trouble fully understanding the ToDictionary extension method's syntax. I also tried foreach'ing the var result to piecewise construct a new dictionary, but to no avail.</p>
  
  <p>Is there something like this (functionality wise):</p>
  
  <pre><code>var results = (from entry in dictionary 
                 orderby entry.Value descending 
                 select entry);
  Dictionary&lt;string,float&gt; newDictionary = results as (Dictionary&lt;string,float&gt;);
  </code></pre>