Find a Key
The ContainsKey method checks if a key already exists in the dictionary. The following code snippet checks if a key already exits and if not, add one.
The ContainsValue method checks if a value is already exists in the dictionary. The following code snippet checks if a value is already exits.
Here is the complete sample code showing how to use these methods.