var employee = new[]{ new{id="2", name="name3"}, new{id="1",name="name4"}, new{id="3",name="name2"}, new{id="1",name="name1"} }; foreach (var emp in employee.OrderBy(c => c.id)) { Console.WriteLine("id:{0} name:{1}", emp.id, emp.name); }请问OrderBy如何实现对id和name同时进行排序(像order by id asc,name asc一样)?
- 2 回答
- 0 关注
- 245 浏览
添加回答
举报
0/150
提交
取消