using System.Collections.Generic;
public static void Main()
List<smth> list = new List<smth>();
list.Add(new smth { id = 1 });
list.Add(new smth { id = 1 });
IEnumerable<IGrouping<int, smth>> groups = list.GroupBy(x => x.id);
IEnumerable<smth> smths = groups.Select(x => x.FirstOrDefault());
List<smth> newList = smths.ToList();
foreach (var s in newList)