I have a Dictionary<string,int>
and I simply want to decrement the value in my dictionary by one.
I have this but not sure if its best practice.
foreach (KeyValuePair<string, int> i in EPCs)
{
EPCs[i.Key] = i.Value - 1;
}
UPDATE: The reason I am trying to decrement the value is becase the value is a index number relating to a position. When I remove something from the dictionary I then have to decrement that index number in the dictionary. There may be a better way.