I have a SortedDictionary, the key is a int value and the matching value to each key is a class object. The class contains a int and a two datetime variable.
I need
SortedDictionary can't be sorted by value, though you can extract a sorted list of values, as the other answers point out.
What you want to do is use a list of keyvaluepairs instead, then sort that, like so:
List> busses = GetMyListOfBusses();
busses.Sort((first, next) => {
return first.Value.InTime.CompareTo(next.Value.Intime);
});
At that point, your keyvaluepair list of busses will be sorted by InTime