using System.Collections.Generic;
public static void Main()
var people = new List<Person>{new Person{GroupId = 1, Name = "Logan", Email = "logan@foo.com"}, new Person{GroupId = 1, Name = "Logan", Email = "logan@foo.com"}, new Person{GroupId = 1, Name = "Logan", Email = "logan@bar.com"}};
var output = new List<Person>{new Person{GroupId = 1, Name = "Toby", Email = "toby@foo.com"}, new Person{GroupId = 1, Name = "Logan", Email = "logan@bar.com"}};
foreach (var person in people)
var e = output.FirstOrDefault(x => x.GroupId == person.GroupId && x.Email == person.Email);
Console.WriteLine("If the dedupe logic didn't work, there would be 5 entries listed below:");
Console.WriteLine("2 entries with \"logan@foo.com\" email addresses");
Console.WriteLine("and 2 entries with \"logan@bar.com\" email addresses.");
foreach (var person in output)
Console.WriteLine("Name: {0}; Email: {1}", person.Name, person.Email);