So I have a Dictionary<string, bool> and all I want to do is iterate over it and set all values to false in the dictionary. What is the easiest way to do that?
I tried this:
foreach (string key in parameterDictionary.Keys)
parameterDictionary[key] = false;
However I get the error: “Collection was modified; enumeration operation may not execute.”
Is there a better way to do this?
Just change the enumeration source to something other than the dictionary.
For .net 2.0