title: ASP.NET MVC - Model.OrderBy Date has no effect
body: <p>I'm having some difficulties to sort my results by Date. Is there any special method?
  Because I'm doing this right now:</p>
  
  <pre><code>var db = new DB();
  var articles = db.Articles;
  var orderedArticles = articles.OrderBy(a =&gt; a.Date);
  return View(orderedArticles.ToList());
  </code></pre>
  
  <p>Where Date is a datetime field.
  And there is no effect for <b>OrderBy(..)</b> or <b>OrderByDescending(..)</b></p>
  
  <p>So I managed to check what is happening.</p>
  
  <p>Everytime I add a new Article I'm just using the date on not the time so
  if I have two articles both for the same day for example:
  with:</p>
  
  <pre><code>var orderedArticles = db.Articles.OrderByDescending(a =&gt; a.Date).ToList();
  </code></pre>
  
  <p>I would have</p>
  
  <pre><code>Id         Title                           Date
  10         First Added  Article            16/09/2009 00:00
  11         Second Added Article            16/09/2009 00:00
  15         Old Article Added Later         15/09/2009 00:00
  </code></pre>
  
  <p>So you can see that is filtering by date, but the thing is when I have the same date the sorting loses the focus.
  So what I did is, orderBy two different contexts like first order by Id and later order by Date:</p>
  
  <pre><code>var orderedArticles = db.Articles.OrderByDescending(a =&gt; a.Id).OrderByDescending(a =&gt; a.Date).ToList();
  </code></pre>
  
  <p>So after this I have the following:</p>
  
  <pre><code>Id         Title                           Date
  11         Second Added Article            16/09/2009 00:00
  10         First Added  Article            16/09/2009 00:00
  15         Old Article Added Later         15/09/2009 00:00
  </code></pre>
  
  <p>I really don't know if this is the right way to do it because the main problem is that when you submit a date field like 16/09/2009 it sets the time to 00:00 and this is a problem on this situation.</p>