Basically I want something like Dictionary
Maybe an option:
Do as John Kugelman suggests, just add an item twice in the same dictionary. Then you keep a second dictionary that maps values to sets of keys.
When you add a key,value pair, you just add it as normal to the first dictionary and then retrieve the key set belonging to that value from the second dictionary and add the key.
Dictionary
Dictionary
Removing a value is done by retrieving the key set from dict2 and removing them one by one from dict1.
The number of keys is dict1.Count and the number of values is dict2.Count