title: Gets exceptions ""at least one object must implement icomparable"" only when apply method ToList() to IQueryable<>
body: <p>When i don't use ToList() method to query firsQue  everything is "Ok!" but i need execute firsQue  immediately!  Then i added to the end ToList() method and got exception in second query secQue "at least one object must implement IComparable".</p>
  
  <hr>
  
  <p>I dont understand that caused it, grouping   performs  by  g.Action.ActionType.Name... It's string, string type implements IComparer interface </p>
  
  <pre><code>static void Main(string[] args)
  {
      var firsQue  = GetAll()
          .SelectMany(s =&gt; s.Goals
              .Where(s2 =&gt; s2.ID == 2)
               .SelectMany(f =&gt; f.Actions
                   .SelectMany(h =&gt; h.GoalProgresses))).ToList();
  
  
      var secQue = (from g in firsQue  
                          group g by g.Action.ActionType.Name into a
                          select new
                          {
                              Name = a.Key,
                              Duration = a.Sum(s =&gt; s.Action.Duration),
                              Done = a.Sum(s =&gt; s.DurationComplete),
                              RemainsToDo = (a.Sum(s =&gt; s.Action.Duration) - a.Sum(s =&gt; s.DurationComplete))
                          })
                           .OrderBy(s =&gt; s)
                           .ToList();
  
      System.Console.ReadLine();
  }
  
  static IQueryable&lt;Patient&gt; GetAll()
  {
      return db.Patients;
  }
  </code></pre>
  
  <p>}</p>