List 排序

1:sort 

这种实现是用朗姆达表达式实现.Comparison<T> 委托详见

http://msdn.microsoft.com/zh-cn/library/tfakywbh.aspx 
List<int> nList= new List<int>(); 
new List<string>(sortStrings).ForEach(e => { nList.Add(int.Parse(e)); });
Item.Sort(
(a, b) =>
{
return nList.FindIndex
(s => s == a.AttributeId) - nList.FindIndex(s => s == b.AttributeId); });

 2:orderby ,OrderByDescending

return list.OrderByDescending(p =>
                {
                    if (true)
                    {
                       return -1;
                    }
                    return 0;
                }).ToList();
原文地址:https://www.cnblogs.com/sheseido/p/4667958.html