title: C# AppSettings array
body: <p>I have some string constants that I need to access from multiple files. Since the values of these constants might change from time to time, I decided to put them in AppSettings rather than a constants class so that I don't have to recompile every time I change a constant.</p>
  
  <p>Sometimes I need to work with the individual strings and sometimes I need to work with all of them at once. I'd like to do something like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
      &lt;appSettings&gt;
          &lt;add key="CONST1" value="Hi, I'm the first constant." /&gt;
          &lt;add key="CONST2" value="I'm the second." /&gt;
          &lt;add key="CONST3" value="And I'm the third." /&gt;
  
          &lt;add key="CONST_ARR" value=[CONST1, CONST2, CONST3] /&gt;
      &lt;/appSettings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The reasoning being that I'll then be able to do stuff like</p>
  
  <pre><code>public Dictionary&lt;string, List&lt;double&gt;&gt; GetData(){
      var ret = new Dictionary&lt;string, List&lt;double&gt;&gt;();
      foreach(string key in ConfigurationManager.AppSettings["CONST_ARR"])
          ret.Add(key, foo(key));
      return ret;
  }
  
  //...
  
  Dictionary&lt;string, List&lt;double&gt;&gt; dataset = GetData();
  
  public void ProcessData1(){
      List&lt;double&gt; data = dataset[ConfigurationManager.AppSettings["CONST1"]];
      //...
  }
  </code></pre>
  
  <p>Is there a way to do this? I'm pretty new to this and I concede that this might be horrendous design.</p>