title: ASP.MVC application constants, what is the best/most elegant approach?
body: <p>Simple question really,</p>
  
  <p>I am just looking for community support what works best architecturally. </p>
  
  <p>Say, following case: <code>TempData["MySetting"]</code>? Where should I store <code>"MySetting"</code>? Should it be </p>
  
  <ol>
  <li>in separate class so that the access will be <code>TempData[Config.MySetting];</code></li>
  <li>in web.config so that the access is <code>TempData[ConfigurationManager.AppSettings["MySetting"];</code></li>
  <li>inline, leave it as string <code>TempData["MySetting"];</code>?</li>
  <li><p>in the DB in some constants table, so that</p>
  
  <pre><code>var mySetting = (string)_db.GetConstant("MySetting");
  TempData[mySetting];
  </code></pre></li>
  </ol>
  
  <p>I would not deal with option 4, just brought it for completeness of the picture.
  So what do you suggest <strong>and why</strong>?</p>
  
  <p><strong>Edit</strong>
  Question is rather general about constants in asp mvc rather than TempData case. </p>
  
  <p>Thanks.</p>