I have a concurrent dictionary and would like to update an object property (e.g. an employee age) by another method:
For example (pseudo code)
class Employee
{
string name;
int age;
}
main()
{
//Sample dic => iDictionary("John", Employee)
UpdateAge(idictionary)
print (idictionary["john"]) // I would like to see the updated value of Employee.age of John here.
}
UpdateAge(iDictionary<string, Employee> idict) {
//update age of John here
}
My idea is to foreach
loop over the key/value pair and search John
then update his age.
foreach (var key in records.Keys) {
//search "John" and update his age
}