If I have an IOrderedEnumberable<Car>
, I sort it and then do a projecting query...
is the order preserved in the projection?
For example, does this scenario work?
IOrderedEnumberable<Car> allCarsOrderedFastestToSlowest =
GetAllCars()
.OrderByDescending(car=>car.TopSpeed);
var top3FastestCarManufacturers =
allCarsOrderedFastestToSlowest
.Select(car=>car.Manufacturer)
.Distinct()
.Take(3);
Does the name of the top3FastestCarManufacturers
variable convey the meaning of what has really happened in the code?