Answer the question
In order to leave comments, you need to log in
How to sort such a dictionary?
There is a class:
public class ClassKey
{
public int Version { get; set; }
public DateTime Date { get; set; }
}
Dictionary<string, ClassKey> dt = new Dictionary<string, ClassKey>();
Answer the question
In order to leave comments, you need to log in
Based on the answer of Dmitry Kovalsky , the following came out. Maybe someone will come in handy.
foreach (var tmp in dt.OrderBy(c => c.Value.Date).OrderBy(c => c.Value.Version))
{
listBox2.Items.Add(string.Format("{0} _ {1} _ {2}", tmp.Key, tmp.Value.Version, tmp.Value.Date));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question