我有这门课:
public class Leg { public int Day { get; set; } public int Hour { get; set; } public int Min { get; set; } }@H_502_3@List<Leg> legs = GetLegs();@H_502_3@现在我想对此列表进行排序.所以我首先要考虑的是日,然后是小时,最后是分钟.
我该如何解决这种排序?谢谢
解决方法
也许是这样的:
List<Leg> legs = GetLegs() .OrderBy(o=>o.Day) .ThenBy(o=>o.Hour) .ThenBy(o=>o.Min).ToList();@H_502_3@