Work in progress
Simple library for reading app.config/web.config appSettings section.
- Diagnostics:
"Foo setting is not set."
exception message instead of gettingnull
. - Some basic parsing out of the box. Also with diagnostics:
"Foo setting should be valid boolean, but was 'not-bool'."
.
Install it:
Install-Package SimplerSettings
Import it:
using SimplerSettings;
Get some settings:
// get your setting
AppSetting setting = AppSettings.Get("SomeSetting");
// check if you found anything
var isSettingSet = setting.IsSet;
// convert it
var stringValue = setting.Value;
var intValue = setting.AsInt();
var boolValue = setting.AsBool();
// or just implicitly cast it
string someString = setting;
int someInt = setting;
bool someBool = setting;