list.Select(a => new { a.proj_cnt, a.area_name, sort = GetSort(a.area_name) }).OrderBy(a => a.sort);
public int GetSort(string name)
{
switch (name)
{
case "广州市": return 1;
case "佛山市": return 2;
case "深圳市": return 3;
case "东莞市": return 4;
default: return 99;
}
}
C#后台自定义规则排序
最新推荐文章于 2024-06-02 22:29:24 发布