c# 拉姆达表达式实现List去重

c# 拉姆达表达式实现List去重

       var list = studentlist.OrderByDescending(a => a.CreateDate).ToList();
       Console.WriteLine(JsonConvert.SerializeObject(list.Where((x, i) => list.FindIndex(z => z.Id == x.Id) == i)));

 

posted @ 2019-05-28 17:20  代码沉思者  阅读(949)  评论(0编辑  收藏  举报