When your web.config or app.config file has an appsettings entry, what is the best way to refer to its key in your code file?
Developers I have worked with have differing opinions on this. Some say to hard code the string and others suggest that there should be a file containing string constants and in your code, you use the constant as the appsettings key.
I would be interested in hearing other opinions on this. What do you do? Why is it the best?
Skip the string constants, and create a configuration wrapper class instead.
Then you could get it like this:
(You might consider not going the static route if you want to remove dependencies on the configuration system while unittesting)