I am having a problem getting a value from my dictionary object. The TryGetValue Method returns true which indicates that it is finding the key in the dictionary but emps variable is not being populated with the value in the dictionary. What am I doing wrong?
thanks for your help!
private Dictionary<int, List<Employee>> _employees;
protected void Page_Load(object sender, EventArgs e)
{
foreach (Schedule s in _departmentSchedules)
{
_employees.Add(s.ID, s.GetEmployees());
}
List<Employee> emps;
_employees.TryGetValue(15, out emps);
Response.Write(emps.count);
}