How to apply multiple orderby in linq query

should be simply a matter of stating

orderby x, y descending, z

see good old ms examples


Borrowing from 101 LINQ Samples:

orderby p.Category, p.UnitPrice descending

or as a Lambda:

products.OrderBy(p => p.Category).ThenByDescending(p => p.UnitPrice); 

Steven's answer will work, but I prefer method chaining to declarative LINQ syntax, e.g.

collection
    .OrderBy(e => e.Property1)
    .ThenByDescending(e => e.Property2)
    .ThenBy(e => e.Property3)

var sortedCollection =
    from item in collection
    orderby item.Property1, item.Property2 descending, item.Property3
    select item;

Tags:

Linq

Sorting