Closed feitzi closed 4 years ago
Thanks @feitzi for a good feedback (contribution will be even better :) ). Yes you can totally do that today with config.net. For instance you can do something like this:
IMySettings settings = new ConfigurationBuilder<IMySettings>()
.UseJsonFile("config.default.json")
.UseJsonFile("config.prod.json") //replace with config.etc.json
.Build();
and so on. It will try to read the values in the order of declaration.
@feitzi you can use the appsettings.json
similar to ASP.NET configuration.
Handling appsettings.json
with environment override file appsettings.{Environment}.json
based on "APP_ENV" environment variable.
See Mapping to appsettings.json file for more information.
I am currently evaluating some configuration libraries. This library looks pretty good to me :) But I am wondering why you do not support fallback scenarios. I want to use a configuration structure like this:
server1.json overrides prod.json and prod.json overrides default.json. Naturally, this works only if you are in prod environment and on a host with name server1
Does config.net support something like this?