Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void SortByName()
- {
- studentList.Sort((b1, b2) => string.Compare(b1.Name, b2.Name));
- }
- int Comparison<in T>(T x, T y)
- public class Student
- {
- public int Age { get; set; }
- public string Name { get; set; }
- }
- var result = students.OrderBy(student =>student.Name).ThenBy(student => student.Age).ToArray();
Add Comment
Please, Sign In to add comment