views:

66

answers:

1

I have the following list

IEnumerable<Car> cars

The Car object has a model and a year. I want to sort this list by model and then year (within model)

what is the best way of doing this ?

+14  A: 
var sortedCars = cars.OrderBy(c => c.Model).ThenBy(c => c.Year);
Anthony Pegram