【发布时间】:2014-04-12 23:32:58
【问题描述】:
我有一个由以下班级组成的清单:
public class Category
{
public int id { get; set; }
public string slug { get; set; }
public string title { get; set; }
public string description { get; set; }
public int parent { get; set; }
public int post_count { get; set; }
}
这是列表。
List<Category> cats = new List<Category>();
我希望我可以根据 id (int) 对其进行排序,但我有一定的顺序:
3、17、13、176、4、177、179、178、180、181、182、183、184、185、186、139
有什么办法吗?
谢谢。
【问题讨论】:
-
你看过 LINQ 吗?