I would like an extension of a question previously posted here
Sort a List of Object in VB.NET
In that question, the OP is asking how to sort a list of objects in VB.NET.
His example uses something like
passenger.name
passenger.age
passenger.surname
And then, the accepted answer uses
theList.Sort(Function(x, y) x.age.CompareTo(y.age))
To that point, everything is ok.
My extension to this is to ask what happens if, for example, I am sorting by age, like the example, however, let's say that 2 passengers have the same age, then, in that case, I would like to use a second parameter (let's say passenger.name
), to sort.
Could it be done using the same theList.Sort
expression?