dibley1973 / OpenRMS

Open RMS is an Open Source project with the intention of delivering a retail management platform that is free to install, use, modify and distribute.
GNU General Public License v3.0
9 stars 7 forks source link

Config #18

Closed johncollinson2001 closed 8 years ago

johncollinson2001 commented 8 years ago

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.

jadjare commented 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

dibley1973 commented 8 years ago

@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.

johncollinson2001 commented 8 years ago

Agreed to use OOTB config in .NET core