Is it possible to replace the Key by which an IGrouping is grouped?
I'm currently grouping by an anonymous type like this:
var groups = orders.GroupBy(o => new { o.Date.Year, o.Date.Month });
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 ToString Method.
public class YearMonth
{
    public int Year { get; set; }
    public int Month { get; set; }
    public override string ToString()
    {
        return Year + "-" + Month;
    }
}
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?
 
    