title: Replace the Key of an IGrouping?
body: <p>Is it possible to replace the <code>Key</code> by which an <code>IGrouping</code> is grouped?</p>
  
  <p>I'm currently grouping by an anonymous type like this:</p>
  
  <pre><code>var groups = orders.GroupBy(o =&gt; new { o.Date.Year, o.Date.Month });
  </code></pre>
  
  <p>But now my grouping key is an anonymous type. I would like to replace this grouping key by a defined Type, "YearMonth", with an overridden <code>ToString</code> Method.</p>
  
  <pre><code>public class YearMonth
  {
      public int Year { get; set; }
      public int Month { get; set; }
  
      public override string ToString()
      {
          return Year + "-" + Month;
      }
  }
  </code></pre>
  
  <p>Is there any way to replace the grouping key? Or to create a new IGrouping out of the existing IGrouping with a new grouping key?</p>