using System.Collections.Generic;
public static void Main()
List<smth> list = new List<smth>();
list.Add(new smth() {header = 1, id = 1});
list.Add(new smth() {header = 1, id = 2});
list.Add(new smth() {header = 1, id = 3});
list.Add(new smth() {header = 2, id = 4});
list.Add(new smth() {header = 3, id = 5});
IEnumerable<IGrouping<int, smth>> groups = list.GroupBy(x => x.header);
foreach (var group in groups)
Console.WriteLine(group.Key);
foreach (var element in group.AsEnumerable() )
Console.WriteLine(String.Format("{0} - {1}", element.header, element.id));