Possible Duplicate:
Dictionary With Value “Variable”
I have some highly coupled code that I am trying to decouple. If I could make a Dictionary like this:
Dictionary<string, var> dict = new Dictionary<string, var>
a lot of coupling could be fixed. One poster in another thread seems to have found a solution using a Variable class but he/she didn't post any details of this class and I can't think of how to do it.
EDIT:
Basically, instead of:
string transit = <string value>;
I would like to be able to write:
string dict["Transit"] = <string value>;
Where I have already done:
Dictionary<string, var> dict = new Dictionary<string, var>()
{
{"Transit", transit}
};
This probably isn't possible but any advice is appreciated.
Regards.