Why does Concurrent Dictionary not have a visible Add() Method?
c#, concurrency, dictionary, multithreading
Solution
That's because of explicit interface implementation. See http://msdn.microsoft.com/en-us/library/aa288461(v=vs.71).aspx
Problem
I was just wondering how it was possible that ConcurrentDictionary does not have an Add method which is visible in the Visual Studio IDE. I only seem to get the TryX Methods e.g TryAdd, TryUpdate etc. I can see that the `ConcurrentDictionary` implements `IDictionary` and if I cast it to `IDictionary` I get the Add Method back. I have looked at the class through iLSpy and I can see the Add Method is fully implemented and does actually call the Concurrent `TryAdd` Method under the hood. I was expecting to see some sort of Attribute on the Add method to surpress it but I am not seeing anything. Has this been baked into the IDE by Microsoft to hide the Add method by default ?? If someone could shed some light on this it would be appreciated