is there a commonly used data structure for mult-key data? e.g. (key1, key2, ..., keyN) -> value. I used to use dictionaries of dictionaries (in c#), and then wrote my own wrapper on top of this to make the syntax look a bit nicer. but it seems like I still have to write a wrapper for each N-dictionary, where N is the number of keys, since I have to define the nested dictionary structure within the code.
assuming I'm using c#, is there a data structure that better encapsulates this sort of usage, and could contain an arbitrary number of keys with hashtable-like lookup performance? I can't simply combine all the keys into a single unique key, because I need to be able to do something like
foreach key2 in data[key1]
foreach key3 in data[key1][key2]
foreach key4 in data[key1][key2][key3]