This is a quick one.
In Linq to sql, I need to order by a datetime field descending then order by the time part of the same datetime filed ascending, make sense? Here's an example of the result needed:
[Serial] [Date (mm-dd-yyyy:hh-MM-ss)]
1 3-13-2008:10-10-02
2 3-13-2008:10-12-60
3 3-12-2008:12-05-55
I tried :
return query.OrderByDescending(c=> c.Time).ThenBy(c=> c.Time.TimeOfDay);
And also tried:
query.OrderByDescending(c => c.Time).ThenBy(c => c.Time.Hour).ThenBy(c=> c.Time.Minute).ThenBy(c=> c.Time.Second);
but never seemed to work.
Any suggestions?