title: linq GroupBy List<Class> into new List<Class>
body: <p>I have a Class called Person</p>
  
  <pre><code>class Person() {
   string Name;
   string SSN;
  }
  </code></pre>
  
  <p>as well as a List That Contains many common instances of the Person class that are duplicates. For Example</p>
  
  <pre><code>   Person.Name = "John";
     Person.SSN = "123456789";
     Person.Name = "John";
     Person.SSN = "123456789";
     Person.Name = "John";
     Person.SSN = "123456789";
     Person.Name = "John";
     Person.SSN = "123456789";
     Person.Name = "John";
     Person.SSN = "123456789";
  </code></pre>
  
  <p>I am trying to figure the syntax out for a Linq statement to just take one of the class objects in the List when common and add it to a new list.</p>
  
  <pre><code>List&lt;Person&gt; newPerson = new List&lt;Person&gt;();
  
  newPerson.AddRange(person.GroupBy(x =&gt; x.Name, x =&gt; x.SSN).Select(grp =&gt; grp.ToList().First()).ToList());
  </code></pre>
  
  <p>Thanks</p>