title: LINQ group by sum not working as expected
body: <p>I have this class:</p>
  
  <pre><code>public class tempClass
  {
      public int myKey { get; set; }
      public int total { get; set; }
  }
  </code></pre>
  
  <p>Code to group by and sum:</p>
  
  <pre><code>var list = new List&lt;tempClass&gt;();
  list.Add(new tempClass { myKey = 1, total = 1 });
  list.Add(new tempClass { myKey = 1, total = 2 });
  list.Add(new tempClass { myKey = 2, total = 3 });
  list.Add(new tempClass { myKey = 2, total = 4 });
  list = list
      .Select(w =&gt; new tempClass { myKey = w.myKey, total = w.total })
      .GroupBy(x =&gt; new tempClass { myKey = x.myKey })
      .Select(y =&gt; new tempClass { myKey = y.Key.myKey, total = y.Sum(z =&gt; z.total) })
      .ToList();
  </code></pre>
  
  <p>The <code>list</code> count is still 4 after the <code>GroupBy</code>.</p>
  
  <p>Same result for code below:</p>
  
  <pre><code>list = list
      .GroupBy(x =&gt; new tempClass { myKey = x.myKey })
      .Select(y =&gt; new tempClass { myKey = y.Key.myKey, total = y.Sum(z =&gt; z.total) })
      .ToList();
  </code></pre>