So I came across an interesting problem today. We have a WCF web service that returns an IList. Not really a big deal until I wanted to sort it.
Turns out the IList interface doesn't have a sort method built in.
I ended up using the
How about using LINQ To Objects to sort for you?
Say you have a
IList<Car>, and the car had an
Engine property, I believe you could sort as follows:
from c in list orderby c.Engine select c;
Edit: You do need to be quick to get answers in here. As I presented a slightly different syntax to the other answers, I will leave my answer - however, the other answers presented are equally valid.