Is there a way to make this method generic so I can return a string, bool, int, or double? Right now, it's returning a string, but if it's able find "true" or "false" as the configuration value, I'd like to return a bool for example.
public static string ConfigSetting(string settingName)
{
return ConfigurationManager.AppSettings[settingName];
}
dynamic
keyword. There's a performance cost for that, but for reading a config file, the performance cost is almost certainly insignificant. – phoog