I would like that with an unique key on web.config, retrieve a dictionary of keyvalues.
To explain myself i little better, i would like to generate a dictionary with as many entries as “key values separated by comma” in the value of MyCodes app setting.
<add key="MyCodes" value="Members,X4567423
NonMembers,Y32453
Registered,Z12312
....
" />
As example and imaging that this is possible i would like to use it like
ConfigurationManager.AppSettings["MyCodes"]["Members"]
Is it possible?
The way you want to access it with
ConfigurationManager.AppSettings["MyCodes"]["Members"]is a dream 🙂What you can do is create a wrapper class that will parse
MyCodesand split them for you. Then you can access the different values not trough yourConfigurationManagerbut trough your wrapper class.