title: Sorting list after Date then time
body: <p>So I'm working on a website ( MVC ) that handles Schedule entries for bands during a festival and I need to present bookings in a logical order and I´m having some unexpected difficulties when I try to order them. My goal is to order them first by date and then by time.</p>
  
  <p>I've  obviously read all similar questions that I could find but none seems to solve the problem.</p>
  
  <p>This is my model (The parts that matter in this situation): </p>
  
  <pre><code>public int ScheduleEntryId { get; set; }
  public int ScheduleId { get; set; }
  public int? BandId { get; set; }
  public int? MovieId { get; set; }
  public int? TechnicianId { get; set; }
  public DateTime? StartTime { get; set; }
  public DateTime? EndTime { get; set; }
  public DateTime EventDate { get; set; }
  </code></pre>
  
  <p>I´m trying to get a sorted list of entries from a specific Band. So this is what I have at the moment:</p>
  
  <pre><code>List&lt;ScheduleEntry&gt; scheduleEntries =
      db.ScheduleEntries.Where(x =&gt; x.BandId == band.BandId)
          .OrderBy(x =&gt; x.EventDate)
          .ThenBy(z =&gt; z.StartTime.Value).ToList();
  </code></pre>
  
  <p>This does sort the entries after the date, but not after time.</p>
  
  <p>I have also tried to seperate the linq and sorting so that I can use .TimeOfDay, since linq does not support that method. This is what I tried:</p>
  
  <pre><code>var scheduleEntries = db.ScheduleEntries.Where(x =&gt; x.BandId == band.BandId).ToList();
  scheduleEntries.OrderByDescending(z =&gt; z.EventDate.Date).ThenBy(z=&gt; z.StartTime.Value.TimeOfDay);
  </code></pre>
  
  <p>I know this is pretty silly and I´m probably missing something obvious, but I just cant get it to work properly. Help would be greatly appreciated.</p>