C# List用Lambda表达式排序

 

降序:

lstroot.Sort((x,y)=>y.static_count.CompareTo(x.static_count));

升序:

lstroot.Sort((x,y)=>x.static_count.CompareTo(y.static_count));

posted @ 2019-01-07 16:45  hellowin  阅读(5233)  评论(0编辑  收藏  举报