LinQ.OrderBy 多个字段排序
作者:互联网
刚开始这样
var StaffLists = StaffList.OrderBy(_ => _.TeamName).OrderBy(_=>_.UserName).ToList()// 排序完全是按照后面UserName排序的跟前面的TeamName字段没关系;
改为
var StaffLists = StaffList.OrderBy(_ => _.TeamName).ThenBy(_=>_.UserName).ToList();
标签:OrderBy,UserName,ToList,TeamName,_.,LinQ,排序 来源: https://www.cnblogs.com/LinWenQiang/p/13278771.html