How to get the dictionary key by using the dictionary value?
when getting the value using the key its like this:
Dictionary dic =
I realize this is an old question but wanted to add something I thought of.
If you know there will be only one key to one value and you'll have to look up via value as well as key; you can create two separate dictionaries. One with the original key as the key and value as the value and the second with the key as the value and value as the key.
Now a side note about this; it does use up more machine resources but I'm guessing it's faster then brute forcing through LINQ and foreach.