I have a list of passengers(object) where it has a differents properties..
passenger.name passenger.age passenger.surname
And I want to sor
To sort by a property in the object, you have to specify a comparer or a method to get that property.
Using the List.Sort method:
List.Sort
theList.Sort(Function(x, y) x.age.CompareTo(y.age))
Using the OrderBy extension method:
OrderBy
theList = theList.OrderBy(Function(x) x.age).ToList()