首页 > 代码库 > LINQ 学习路程 -- 查询操作 ThenBy & ThenByDescending
LINQ 学习路程 -- 查询操作 ThenBy & ThenByDescending
IList<Student> studentList = new List<Student>() { new Student() { StudentID = 1, StudentName = "John", Age = 18 } , new Student() { StudentID = 2, StudentName = "Steve", Age = 15 } , new Student() { StudentID = 3, StudentName = "Bill", Age = 25 } , new Student() { StudentID = 4, StudentName = "Ram" , Age = 20 } , new Student() { StudentID = 5, StudentName = "Ron" , Age = 19 }, new Student() { StudentID = 6, StudentName = "Ram" , Age = 18 } }; var thenByResult = studentList.OrderBy(s => s.StudentName).ThenBy(s => s.Age); var thenByDescResult = studentList.OrderBy(s => s.StudentName).ThenByDescending(s => s.Age);
LINQ 学习路程 -- 查询操作 ThenBy & ThenByDescending
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。