How do I create a multiple-key dictionary?
I have a need for a multiple-key dictionary. For example:
Dictionary<Key1, Key2, Key3, Value>
where Key1, Key2, and Key3 have different type.
Zhang Zhao, Dec 16, 2010
Hey card game player if you are interested in playing the single player card game then here you will play spider solitaire games without any download and subscription.
Himanshu Mishra, May 28, 2018
You can also use Tuple, to achieve this...
Robert Blixt, Dec 20, 2010
What if you create a unique hash for the 3 concatenated keys?
Then use this as the unique key in a regular Dictionary.
So, something like:
Dictionary<string, object> dictionary = new Dictionary<string, object>();
dictionary.Add( Hash(key1, key2, key3), myObject);
where Hash is a simple method that concatenates the 3 keys (the arguments) and returns a hash.
Deshaun Hyram, Dec 16, 2010