//定义一个集合
var list = new List<Object>();//这里的Object为对象类型
//假设list已经有数据存进去,根据对象的某个字段升序或降序
var orderInfo = list.OrderByDescending(a => a.ID).ToList();//降序
var orderInfo = list.OrderBy(a => a.ID).ToList();//升序
//定义一个集合
var list = new List<Object>();//这里的Object为对象类型
//假设list已经有数据存进去,根据对象的某个字段升序或降序
var orderInfo = list.OrderByDescending(a => a.ID).ToList();//降序
var orderInfo = list.OrderBy(a => a.ID).ToList();//升序