1 List<EmployeeInfo> all = LoadData(); 2 List<string> result = (from r in all 3 group r by r.department into g 4 select g.Key).ToList<string>(); 5 6 7 list.Sort((x, y) => { return y.id.CompareTo(x.id); });
1 List<EmployeeInfo> all = LoadData(); 2 List<string> result = (from r in all 3 group r by r.department into g 4 select g.Key).ToList<string>(); 5 6 7 list.Sort((x, y) => { return y.id.CompareTo(x.id); });