using System.Collections.Generic;
static void AddBirthdayToDictionary(Dictionary<DateTime, List<string>> dict, int month, int day, string name)
var bdate = new DateTime(DateTime.MinValue.Year, month, day);
if(!dict.TryGetValue(bdate, out val))
val = new List<string>();
static List<string> GetBirthdays(Dictionary<DateTime, List<string>> dict, int month, int day)
var bdate = new DateTime(DateTime.MinValue.Year, month, day);
if(dict.TryGetValue(bdate, out val))
return new List<string>();
public static void Main()
var birthdayDictionary = new Dictionary<DateTime, List<string>>();
AddBirthdayToDictionary(birthdayDictionary, 3, 26, "Person 1");
AddBirthdayToDictionary(birthdayDictionary, 3, 26, "Person 2");
var today = DateTime.Today;
var bdayList = GetBirthdays(birthdayDictionary, today.Month, today.Day);
var count = bdayList.Count();
Console.WriteLine(string.Format("Hello, today is {0} and {1} {2} celebrating {3} birthday!", today, string.Join(", ", bdayList), (count>1) ? "are":"is", (count>1) ? "their" : "its"));