title: Retrieve values from a config file into a class, in C#?
body: <p>Using C#. how would one get values from a config file into a class? I guess you can pass a key and it will get the value based on that.</p>
  
  <p>I know you can use</p>
  
  <pre><code>string value = ConfigurationManager.AppSettings["test"];
  </code></pre>
  
  <p>But I thought there might be a better way, maybe using it in a class?</p>
  
  <p>Is this OK?</p>
  
  <pre><code>public static string GetKey(string value)
  {
     get 
     {
        return ConfigurationSettingAppSetting[value];
     }
  }
  </code></pre>
  
  <p>and to use it I use</p>
  
  <pre><code>GetKey("test");
  </code></pre>
  
  <p>Is this good or good pratice using it as a static?</p>
  
  <p>thanks</p>