Closed johncollinson2001 closed 8 years ago
Apologies if this response duplicates! I sent it on email, but don't think it sent properly!!... here's what I sent...
Hi John,
I see good old Properties.Settings has gone ☹!!
Anyway I did a quick google to see if there was an alternative recommended approach... this directed me to a Rick Strahl post which suggests Microsoft have authored a package to aid with configuration injection. Looks like it allows for a json file to be mapped to a strongly typed class or something along those lines... only skim read the article at this stage.
https://weblog.west-wind.com/posts/2016/may/23/strongly-typed-configuration-settings-in-aspnet-core
@johncollinson2001 - TBH, it had not crossed my mind yet. I have created custom strongly typed ConfigManagers / CookieManagers / SessionManagers in the past so like that approach.
@jadjare - A good read that. looks like once you learn it that will be quite neat. I'd rather go for the strongly typed flavour even if it does mean a full restart of the app if you change a value.
Agreed to use OOTB config in .NET core
Just wondered if anyone has strong feelings on config.
I think. Net core has new APIs to get config, I was going to whack a json file into the solution and create a simple manager to access the values.