title: Group by key and send values into list using LINQ
body: <p>Say I have a simple address class like below:</p>
  
  <pre><code>public class Address
  {
      public int AddressId { get; set; }
      public List&lt;int&gt; NodeIds { get; set; }
  }
  </code></pre>
  
  <p>and have populated a list of addresses like below:</p>
  
  <pre><code>List&lt;Address&gt; listOfAddresses = new List&lt;Address&gt; 
  {
      new Address {AddressId=1, NodeIds=new List&lt;int&gt;{1}},
      new Address {AddressId=2, NodeIds=new List&lt;int&gt;{2}},
      new Address {AddressId=3, NodeIds=new List&lt;int&gt;{3}},
      new Address {AddressId=1, NodeIds=new List&lt;int&gt;{4}},
      new Address {AddressId=1, NodeIds=new List&lt;int&gt;{5}}
  }
  </code></pre>
  
  <p>and I want to group by on AddressIds so the result list will have NodeIds that are essentially rolled up in case of duplicates like below:</p>
  
  <pre><code>listOfAddressesWithoutDupes = 
  AddressId=1, NodeIds=List&lt;int&gt;{1,4,5},
  AddressId=2, NodeIds=List&lt;int&gt;{2}},
  AddressId=3, NodeIds=new List&lt;int&gt;{3}
  </code></pre>
  
  <p>so basically I am looking at a groupby function(or something else) that will get me above 
  result</p>
  
  <pre><code>List&lt;Address&gt; listOfFilteredAddresses = listOfAddresses.GroupBy(x=&gt;x.AddressId).Select(y=&gt;new Address{AddressId=y.Key, NodeIds=?});
  </code></pre>
  
  <p>Thanks in advance..</p>