You can’t modify it, you can replace it with a new one.
var newEntry = new KeyValuePair<TKey, TValue>(oldEntry.Key, newValue);
or for dictionary:
dictionary[oldEntry.Key] = newValue;
You can’t modify it, you can replace it with a new one.
var newEntry = new KeyValuePair<TKey, TValue>(oldEntry.Key, newValue);
or for dictionary:
dictionary[oldEntry.Key] = newValue;