using System.Collections.Generic;
public static void Main()
IDictionary<string, object> userDict = new Dictionary<string, object>();
IDictionary<string, object> user1 = new Dictionary<string, object>();
IDictionary<string, object> user2 = new Dictionary<string, object>();
const string scoreKey = "score";
const string nameKey = "name";
user1.Add(nameKey, "John");
user2.Add(nameKey, "Pete");
userDict.Add("<userid1>", user1);
userDict.Add("<userid2>", user2);
var highscores = userDict
.OrderByDescending(u => ((IDictionary<string, object>)u.Value)[scoreKey])
Name = ((IDictionary<string, object>)u.Value)[nameKey],
Score = ((IDictionary<string, object>)u.Value)[scoreKey]
foreach(var score in highscores) {
Console.WriteLine("Name: " + score.Name + " , Score: " + score.Score);