用一句Linq把一个集合的属性值根据条件改了,其他值不变

 

list去重

list.Where((x, i) => list.FindIndex(z => z.Miid == x.Miid) == i)

list.Distinct();//这个方法 貌似不起作用,不是很好用,上面那一句 有作用!

Dictionary排序:参考文章:javascript:void(0)
Dictionary<DateTime, String> dicAsc = dd.OrderBy(p => p.Key).ToDictionary(p => p.Key, p => p.Value);
Dictionary<DateTime, String> dicDesc = dd.OrderByDescending(p => p.Key).ToDictionary(p => p.Key, p => p.Value);