I'm always confused on which one of these to pick. As I see it I use Dictionary
over List
if I want two data types as a Key
and Value
so I can easily find a value by its key
but I am always confused if I should use a ConcurrentDictionary
or Dictionary
?
Before you go off at me for not putting much research in to this I have tried, but it seems google hasn't really got anything on Dictionary
vs ConcurrentDictionary
but has something on each one individually.
I have asked a friend this before but all they said is: "use ConcurrentDictionary
if you use your dictionary a lot in code" and I didn't really want to pester them in to explaining it in larger detail. Could anyone expand on this?