This is a migrated thread and some comments may be shown as answers.

OrderBy Desc?

2 Answers 124 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Duncan
Top achievements
Rank 2
Duncan asked on 02 Nov 2011, 07:03 PM
Simple questions... I need to get the DESC order. How do i do that in this call:

IList<SomeTable> sometable = dbContext.SomeTable.Where(t => t.SomeTableID == 2).OrderBy(t => t.DateTime).Take(10).ToList();

Thanks in advance,
Duncan

2 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 02 Nov 2011, 07:07 PM
Hi Duncan,

.OrderByDescending(lambda) is your friend.

Kind regards,
Thomas
the Telerik team

NEW and UPDATED OpenAccess ORM Resources. Check them out!

0
Duncan
Top achievements
Rank 2
answered on 02 Nov 2011, 07:09 PM
:) Awesome!!

Thanks for the quick reply!

Duncan
Tags
LINQ (LINQ specific questions)
Asked by
Duncan
Top achievements
Rank 2
Answers by
Thomas
Telerik team
Duncan
Top achievements
Rank 2
Share this question
or