Skip to content

Instantly share code, notes, and snippets.

@csdear
Created October 11, 2016 15:03
Show Gist options
  • Save csdear/57bd1f3d8121991dfcd4c99184aaa2d9 to your computer and use it in GitHub Desktop.
Save csdear/57bd1f3d8121991dfcd4c99184aaa2d9 to your computer and use it in GitHub Desktop.
App Settings Application Settings Configuration Settings No magic numbers
//e.g., key in the web config
<appSettings>
<add key="FromAddress" value="someEmail@gmail.com"/>
</appSettings>
***
//namespace to call.
+using System.Configuration;
// e.g., calling the value.
protected virtual string FromAddress { get { return ConfigurationManager.AppSettings["FromAddress"]; } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment