Student[] stuArray =
{
new Student("chandler",20,"男"),
new Student("joe",39,"男"),
new Student("rose",38,"男"),
new Student("monica",28,"女"),
new Student("rachel",27,"女"),
new Student("phobee",27,"女")
};
var query = from st in stuArray orderby st.Name.Length, st.Age ascending select st;
foreach (var item in query)
{
Console.WriteLine(item.ToString());
}
Linq查询之多个排序条件
最新推荐文章于 2024-08-09 22:14:30 发布