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();
04-15 08:58