title: linq grouping result takes a long time
body: <p>I have the following method that does some grouping</p>
  
  <pre><code>private List&lt;CatalogVehicle&gt; GroupResult(IEnumerable&lt;VehicleAndQuote&gt; vehiclesAndQuotes)
      {
          var vehicles = vehiclesAndQuotes
              .GroupBy(vehicleAndQuote =&gt;
                  new
                  {
                      vehicleAndQuote.Vehicle.VehicleMakeName,
                      vehicleAndQuote.Vehicle.VehicleModelTypeName,
                      vehicleAndQuote.Vehicle.VehicleEdition
                  })
              .Select(a =&gt; new
              {
                  vehicle = _mapper.Map&lt;VehicleAndQuote, CatalogVehicle&gt;(a.First()),
                  plans = GetLeasingpPlansGroupedByYearlyMileages(a.ToList()) //&lt;== this one is taking ages
              })
              .Select(a =&gt;
              {
                  a.vehicle.LeasingPlans = a.plans;
                  return a.vehicle;
              });
  
          return vehicles.ToList();
      }
  </code></pre>
  
  <p>and the method that is calling within;</p>
  
  <pre><code>    private List&lt;LeasingPlan&gt; GetLeasingpPlansGroupedByYearlyMileages(IEnumerable&lt;VehicleAndQuote&gt; vehicleAndQuotes)
      {
          return vehicleAndQuotes.GroupBy(quote =&gt; quote.Quote.YearlyMileage)
              .Select(group =&gt; _mapper.Map&lt;List&lt;VehicleAndQuote&gt;, LeasingPlan&gt;(group.ToList()))
              .ToList();
      }
  </code></pre>
  
  <p>the last method takes quite a long time. 
  the <code>IEnumerable&lt;VehicleAndQuote&gt; vehiclesAndQuotes</code> is about 30.000 records. 
  Is there any performance gainer that I am not seeing?</p>