I had the following method in my code. My boss asked "why are you using a dictionary", you can just use an array, it's more efficient:
public static Dictionary<string, string> GetListOfMonths()
{
Dictionary<string, string> months = new Dictionary<string, string>();
months.Add("1", "Jan");
months.Add("2", "Feb");
months.Add("3", "Mar");
months.Add("4", "Apr");
months.Add("5", "May");
months.Add("6", "Jun");
months.Add("7", "Jul");
months.Add("8", "Aug");
months.Add("9", "Sep");
months.Add("10", "Oct");
months.Add("11", "Nov");
months.Add("12", "Dec");
return months;
}
I use this for code reuse..so that I can bind to some month dropdown menus in various parts of our application.