I am trying to make a Dictionary lookup table in C#. I need to resolve a 3-tuple of values to one string. I tried using arrays as keys, but that did not work, and I don’t know what else to do. At this point I am considering making a Dictionary of Dictionaries of Dictionaries, but that would probably not be very pretty to look at, though it is how I would do it in javascript.
Share
If you are on .NET 4.0 use a Tuple:
If not you can define a
Tupleand use that as the key. The Tuple needs to overrideGetHashCode,EqualsandIEquatable: