dictionary in loop c# code example
Example 1: iterate through dictionary c#
foreach(var item in myDictionary)
{
foo(item.Key);
bar(item.Value);
}
Example 2: c# modify dictionary in loop
List<string> keys = new List<string>(colStates.Keys);
foreach(string key in keys)
{
colStates[key] += 4;
}