VasilKotsev

LINQ SORT

Sep 6th, 2018
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.24 KB | None | 0 0
  1. foreach (Dwarf dwarf in dwarves.OrderByDescending(x => x.Physics).ThenByDescending(x => dwarves.Count(y => y.Color == x.Color)))
  2.             {
  3.                 Console.WriteLine($"({dwarf.Color}) {dwarf.Name} <-> {dwarf.Physics}");
  4.             }
Advertisement
Add Comment
Please, Sign In to add comment