Guest User

Untitled

a guest
Dec 14th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. public void SortByName()
  2. {
  3. studentList.Sort((b1, b2) => string.Compare(b1.Name, b2.Name));
  4. }
  5.  
  6. int Comparison<in T>(T x, T y)
  7.  
  8. public class Student
  9. {
  10. public int Age { get; set; }
  11.  
  12. public string Name { get; set; }
  13. }
  14. var result = students.OrderBy(student =>student.Name).ThenBy(student => student.Age).ToArray();
Add Comment
Please, Sign In to add comment