As you talk about the decline in your query, I assume you need the last 10 instances. If so
var sortedDict = (from entry in dd orderby entry.Value descending select entry)
.Take(10)
.ToDictionary(pair => pair.Key, pair => pair.Value) ;
var sortedDict = dd.OrderByDescending(entry=>entry.Value)
.Take(10)
.ToDictionary(pair=>pair.Key,pair=>pair.Value);
If you need the first 10, just delete descendingand it will work fine.
var sortedDict = (from entry in dd orderby entry.Value select entry)
.Take(10)
.ToDictionary(pair => pair.Key, pair => pair.Value) ;
var sortedDict = dd.OrderBy(entry=>entry.Value)
.Take(10)
.ToDictionary(pair=>pair.Key,pair=>pair.Value);
source
share