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 to sort my SortedDictionary based on the InTime datetime in my class. So that when I do a foreach to loop through my SortedDictionary I will have them sorted based on datetime.
Is this possible? How can I achieve it?
enter code here
class Busdetail
{
public int BusNo { get; set; }
public DateTime InTime { get; set; }
public DateTime OutTime { get; set; }
}