Reputation: 221
I need to get data from dictionary that is in format like this :
private Dictionary<string, Dictionary<string, string>> MyDictionary = new Dictionary<string, Dictionary<string, string>>()
{
{"HEIGHT", new Dictionary<string,string>(){{"table", "TR_HEIGHT"}, {"prefix", "HEI"}}},
{"WEIGHT", new Dictionary<string,string>(){{"table", "TR_WEIGHT"}, {"prefix", "WIL"}}},
{"LENGTH", new Dictionary<string,string>(){{"table", "TR_LENGTH"}, {"prefix", "LEN"}}},
};
It is posible to if I insert "HEIGHT" i get back prefix is "HEI" and table is "TR_HEIGHT"?
Thank's
Upvotes: 0
Views: 93
Reputation: 460158
It is posible to if I insert "HEIGHT" i get back prefix is "HEI" and table is "TR_HEIGHT"?
Yes
Dictionary<string, string> heightAttr = MyDictionary["HEIGHT"];
string table = heightAttr["table"]; // TR_HEIGHT
string prefix = heightAttr["prefix"]; // HEI
Upvotes: 2