Mohamed Bana | 9 Feb 22:05
Picon
Gravatar

sort on two keys

Hi All,

What would be the equivalent of the C# program below?

var counts = new Dictionary<string, int>();

var sortedDict =
  from entry in counts
  orderby entry.Value descending, entry.Key ascending
  select entry;

that is, sort by max no. then alphabetically.

—Mohamed


Gmane