I am trying to make a change to a KeyValuePair and have got as far as this code from another post I found:
var keysToModify = this.Properties
.Where(k => k.Key == propertyName)
.ToList();
foreach (var key in keysToModify)
{
this.Properties[key] = newValue;
}
But my key field is a string not an int. What would I need to do to update a KeyValuePair in this case?
EDIT : My KeyValuePair is of type string,string, and when I run the code in my example above, I get the error :
keyvaluepair is not assignable to parameter type int