A Repasky

A Repasky

  • NA
  • 231
  • 183.7k

How to check for the keys when you have a dictionary in a dictionary

Aug 18 2011 3:21 PM
How can I write the if statement to check if the keys are not in the dictionary
when I have a dictionary in a dictionary?
I started the if statement, but I do not know how to finish it.
Code is below.

Thanks,
arep
 


 public static Dictionary<stringDictionary<stringDebOop>> d = new Dictionary<stringDictionary<stringDebOop>>();
   public static void GetData(string memberNbr, string person, string group, string subGroup, string plancode, string date)
 {
 int year = (DateTime.ParseExact(date, "yyyy-MM-dd"CultureInfo.InvariantCulture)).Year;
 //Is key not in dictionary
 if (!d.ContainsKey(memberNbr))
 {
 UpdateData(memberNbr, person, group, subGroup, plancode, date);
 }
 }

Answers (11)