Reputation: 1049
I have IList<customClass>
My CustomClass: CreatedDate(DateTime), Name(string), Number(int)
I use OrderBy(p => p.CreatedDate)
My question: how do I custom or find a way to order CreatedDate just only Date, not include Time when order?
Upvotes: 2
Views: 818
Reputation: 73442
Given that CreatedDate
is of type DateTime
you can do the following.
OrderBy(p => p.CreatedDate.Date)
Upvotes: 8