I have a list of Func defining an ordering:
var ordering = new List<Func<Person, IComparable>>
{ x => x.Surname, x => x.FirstName };
I can order the results with something like…
people = people.OrderBy(ordering[0]).ThenBy(ordering[1]);
I’m trying to figure how to do the above when the list can contain any number of sequential orderings. Is it possible?
is the same as
so you simply write a loop like this: