using System.Collections.Generic;
public static void Main()
Thing unique1 = new Thing("test", 1);
Thing unique2 = new Thing("test1", 1);
Thing unique3 = new Thing("test", 2);
Thing dup1 = new Thing("test", 1);
Thing dup2 = new Thing("test", 1);
List<Thing> duplicateThings =
.GroupBy(thing => new { thing.Name, thing.ServiceGroup })
.Where(group => group.Count() > 1)
.SelectMany(group => group.ToList())
foreach(Thing thing in duplicateThings)
Console.WriteLine("{0}:{1}", thing.Name, thing.ServiceGroup);
public string Name { get; set; }
public int ServiceGroup { get; set; }
public Thing(string name, int serviceGroup)
this.ServiceGroup = serviceGroup;