C# Dictionary question.

Balthazar

Golden Member
Apr 16, 2000
1,834
0
0
Can anyone point me to a good resource on how to make a dictionary containing a dictionary in C#????

I have been trying all morning but cannot get this stupid concept to work (should be simple I would think.).

Thanks in advance.
 

Balthazar

Golden Member
Apr 16, 2000
1,834
0
0
Also, a little insight on how I am doing it now (which works, but seems pretty ungodly inefficient).

Right now I am creating a class from the DictionaryBase Abstract class, I define my methods, like Add().

And right now the only way I can see to get it to allow me to create a dictionary in a dictionary is to overload my Add method with string item, object value. And so on and so forth. But this means Ihave to overload the method for EVERY possible combination.

So i have one overload for string, int string, string int, int int, string string, object int, object object, object

etc. etc. etc.

now, it might be just me, but that seems pretty ghetto....i understand the need for defining overloads in alot of cases, but in this case, the method overloads are IDENTICAL....they don't do anything different depending on the type passed to them.

So am I high or is there a better way of doing thing?