fork(1) download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. class Foo
  6. {
  7. public int Importance { get; set; }
  8.  
  9. public string Name { get; set; }
  10. }
  11.  
  12. public class Test
  13. {
  14. public static void Main()
  15. {
  16. var fooList = new List<Foo>();
  17. fooList.Add(new Foo { Name = "Foo1", Importance = 1 });
  18. fooList.Add(new Foo { Name = "Foo2", Importance = 1 });
  19. fooList.Add(new Foo { Name = "Foo3", Importance = 1 });
  20.  
  21. fooList = fooList.OrderBy(x=>x.Importance).ThenBy(x=>x.Name).ToList();
  22.  
  23. Console.WriteLine(fooList[0].Name);
  24.  
  25. fooList = fooList.OrderBy(x=>x.Importance).ThenBy(x=>x.Name).ToList();
  26.  
  27. Console.WriteLine(fooList[0].Name);
  28. }
  29. }
Success #stdin #stdout 0.07s 34168KB
stdin
Standard input is empty
stdout
Foo1
Foo1