Reading Configuration Values in Dotnet core using Options Pattern
Normally every project will have some values to be read from config files like user name, connection strings, environment specific details etc. Dotnet Framework In dotnet framework projects, this can be easily done by using Configuration Manager. This is available when we add System.Configuration assembly reference. Let us look at an example of a app config file like below <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <appSettings> <add key="Url" value="https://www.saucedemo.com/"/> <add key="UserName" value="standard_user"/> <add key="Password" value="secret_sauce"/> </appSettings> </configuration> Storing user name and password in app config is not a best practise. For sake of simplicity , let us keep it here. In dotnet framework , we can read above config values with below ...