title: How to sort by descending nested Dictionary in C# using LINQ
body: <p>I need some help to sort by descending nested Dictionary which is quite hard for me because I'm not so advanced , I've been searching many sites but with no success. If someone can give me a hand with this I'll be grateful. So here is the code</p>
  
  <pre><code>Dictionary&lt;string, Dictionary&lt;string, int&gt;&gt; champLeague = new Dictionary&lt;string, Dictionary&lt;string, int&gt;&gt;();
  </code></pre>
  
  <p>For example when I add -</p>
  
  <p>Barcelona, Arsenal, 1</p>
  
  <p>Man Unted, Liverpool, 2</p>
  
  <p>Man City, Stoke City, 3</p>
  
  <p>And I want to print out the dictionary ordered by descending by the second dictionary's value like this :</p>
  
  <pre><code>var orderedDic = champLeague.OrderByDescending(x =&gt; x.Value.Values).ThenBy(x =&gt; x.Value.Keys)
  </code></pre>
  
  <p>And try <code>foreach(var kvp in orderedDic){Console.WriteLine(kvp.Key)}</code>
  It throws me an exception : "unhandled exception at least one object must be implemented IComparable"</p>
  
  <p>I want to look like this :</p>
  
  <p>Man City</p>
  
  <p>Man United</p>
  
  <p>Barcelona</p>