I have a Test class.
class Test
{
public int Id { get; set; }
public int Val { get; set; }
}
I would like to setup a ConcurrentDictionary with an int as Key and Test as the value.
bool External = true;
ConcurrentDictionary<int, Test> data = new ConcurrentDictionary<int, Test>();
I would like to write the Update part of AddorUpdate for this dictionary so that if an external variable (say External) is true then the Val for that instance of Test should increment by 100 but if bool is false then it should decrement by 100. Can someone help me how can I do it. I am just not sure how can I get access to the Test instance in the dictionary using a lambda. Also can I have an method call in spite of the lambda?