No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
StronglyTypedAppSettings.Console
StronglyTypedAppSettings
packages
.gitignore
README.md
StronglyTypedAppSettings.sln

README.md

StronglyTypedAppSettings

Use Dependency Injection to enable Strongly Typed Application Settings

CODE:

System.Console.WriteLine("The bad"); System.Console.WriteLine(ConfigurationManager.AppSettings["ConfigSettings.SampleSetting1"]); System.Console.WriteLine(ConfigurationManager.AppSettings["ConfigSettings.SampleSetting2"]);

System.Console.WriteLine(); System.Console.WriteLine();

System.Console.WriteLine("The better"); var settings = new SettingsInstanceFactory().GetInstanceOfConfigSettings(); System.Console.WriteLine(settings.SampleSetting1); System.Console.WriteLine(settings.SampleSetting2);

OUTPUT:

The bad My value for ConfigSettings.SampleSetting1 My value for ConfigSettings.SampleSetting2

The better My value for ConfigSettings.SampleSetting1 My value for ConfigSettings.SampleSetting2 Press any key to continue . . .