using System.Collections.Generic;
public static void Main()
List<Foo> fooInstance = new List<Foo>{ new Foo{ Name="First", Id= 1 }, new Foo{ Name="Second", Id= 2 }, new Foo{ Name="Third", Id= 3 }};
var grouped = fooInstance.GroupBy(f => (f.Name, f.Id));
foreach(var groupElem in grouped)
Console.WriteLine(groupElem.Key.Name);