Help me pls to understand how does ConcurrentDictionary work? I have this:
UsersOnlineClass client;
if (UsersOnlineDictionary.TryGetValue(comClientID, out client)) { }
I have to change some value in client and save changes in ConcurrentDictionary. As will be right?
UsersOnlineClass updatedClient = new UsersOnlineClass();
updatedClient = client; //make copy
updatedClient.someInt = -1;
if (UsersOnlineDictionary.TryUpdate(client.Client_id, updatedClient, client)) { }
or I can just do so, and that will be enough?
client.someInt = -1;