//正常是直接用Distinct去重
List<int> list = new List<int>() { 1, 1, 2, 2, 3, 4, 5};
list = list.Distinct().ToList();
//如果List中存储的是对象,则需要这样去重
List<User> list = new List<User>();
list = list.Where((x, i)=>list.FindIndex(z => z.Id == x.Id) == i).ToList();//我这里是根据Id去重