title: How to resolve issue: "At least one object must implement IComparable."
body: <p>So here's the line that is erring:</p>
  
  <pre><code>@For Each item In futureClasses.OrderBy(
          Function(c) c.ClassDates.OrderBy(
              Function(d) d.Value).ToList).ToList
  </code></pre>
  
  <p>The relevant parts of the class structure are:</p>
  
  <pre><code>Public Class [Class]
    Public Property ClassDates As List(Of ClassDate) = New List(Of ClassDate)
  End Class
  
  Public Class ClassDate
    Implements IComparable(Of ClassDate)
  
    Public Property Value As Date
  
  Public Function CompareTo(other As ClassDate) As Integer Implements IComparable(Of ClassDate).CompareTo
    Return Me.Value &lt; other.Value
  End Function  
  
  End Class
  </code></pre>
  
  <p>The idea is to construct a list of <code>[Class]</code> objects (to iterate over) that are in order by which one occurs first in the stream of time.</p>
  
  <p>The error I get is:</p>
  
  <blockquote>
    <p>At least one object must implement IComparable. </p>
  </blockquote>
  
  <p>I've set a breakpoint on that line.  When the error occurs <code>futureClasses</code> contains 2 <code>[Class]</code> elements, each with a single <code>ClassDate</code>.  </p>
  
  <p>The values are:<br>
  <code>futureClasses(0).ClassDates(0).Value = #3/13/2014#</code><br>
  <code>futureClasses(1).ClassDates(0).Value = #4/17/2014#</code></p>
  
  <p>Does anyone see why this wee or is being thrown?</p>