title: Find object data duplicates in List of objects
body: <p>Using c# 3 and .Net Framework 3.5, I have a Person object</p>
  
  <pre><code>public Person
  {
      public int Id { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public int SSN { get; set; }
  }
  </code></pre>
  
  <p>and I've got a List of them:</p>
  
  <pre><code>List&lt;Person&gt; persons = GetPersons();
  </code></pre>
  
  <p>How can I get all the Person objects in persons where SSN is not unique in the list and remove them from the persons list and ideally add them to another list called "<code>List&lt;Person&gt; dupes</code>"?</p>
  
  <p>The original list might look something like this:</p>
  
  <pre><code>persons = new List&lt;Person&gt;();
  persons.Add(new Person { Id = 1, 
                           FirstName = "Chris", 
                           LastName="Columbus", 
                           SSN=111223333 }); // Is a dupe
  persons.Add(new Person { Id = 1, 
                           FirstName = "E.E.", 
                           LastName="Cummings", 
                           SSN=987654321 });
  persons.Add(new Person { Id = 1, 
                           FirstName = "John", 
                           LastName="Steinbeck", 
                           SSN=111223333 }); // Is a dupe
  persons.Add(new Person { Id = 1, 
                           FirstName = "Yogi", 
                           LastName="Berra", 
                           SSN=123456789 }); 
  </code></pre>
  
  <p>And the end result would have Cummings and Berra in the original persons list and would have Columbus and Steinbeck in a list called dupes.</p>
  
  <p>Many thanks!</p>