I have to configure a list of values in the web.config of MVC 5 application.
Is there a way to read multiple appSettings values? For example get all that have some prefix.
<appSettings>
<add key="mylist_1" value="val1" />
<add key="mylist_2" value="val2" />
<add key="mylist_3" value="val3" />
<add key="mylist_4" value="val4" />
<add key="otherlist_1" value="val1" />
<add key="otherlist_2" value="val2" />
<add key="otherlist_3" value="val3" />
<add key="otherlist_4" value="val4" />
</appSettings>
I have to get mylist_1 or otherlist_1.
The simple option is to put all the values under one key, delimited by some char and split the string in the code.