If you want to use the method syntax, use ThenBy() , as others suggested:
listOfPeople.OrderBy(person => person.LastName) .ThenBy(person => person.FirstName)
In the query syntax, the same thing can be done the way you wanted: two sort keys, separated by a comma:
from person in listOfPeople orderby person.LastName, person.FirstName select person
The above code will actually be compiled for code that uses OrderBy() and ThenBy() , as in the first example.
Also, if you want to have OrderBy() that accepts two (or more) sort keys, you can of course write this as an extension method on IEnumerable<T> , which internally calls OrderBy() and ThenBy() .
svick Jun 08 2018-12-12T00: 00Z
source share