I only want to remove a value.. I don’t need to use the variable afterwards. Why not include an overload where this second parameter was not required?
Do I really have to just store it in a temporary local variable, not use it, and have the garbage collector collect it when the method ends? Seems rather silly..
The function: http://msdn.microsoft.com/en-us/library/dd287129.aspx
You can create exactly the method you want:
UPDATE: Or, as Dialecticus mentioned in the comments, just use
Remove. But note that, since it’s an explicit interface implementation, you’ll need a reference to anIDictionary<TKey, TValue>, which leads you back to creating an extension method if you want to avoid casting aConcurrentDictionary<TKey, TValue>reference: