刚开始这样
var StaffLists = StaffList.OrderBy(_ => _.TeamName).OrderBy(_=>_.UserName).ToList()// 排序完全是按照后面UserName排序的跟前面的TeamName字段没关系;
改为
var StaffLists = StaffList.OrderBy(_ => _.TeamName).ThenBy(_=>_.UserName).ToList();
2023-12-05 22:17:16
刚开始这样
var StaffLists = StaffList.OrderBy(_ => _.TeamName).OrderBy(_=>_.UserName).ToList()// 排序完全是按照后面UserName排序的跟前面的TeamName字段没关系;
改为
var StaffLists = StaffList.OrderBy(_ => _.TeamName).ThenBy(_=>_.UserName).ToList();