Skip to content

Instantly share code, notes, and snippets.

Created December 16, 2018 15:52
What would you like to do?
public class ConfigurationService : IConfigurationService
public IEnvironmentService EnvService { get; }
public ConfigurationService(IEnvironmentService envService)
EnvService = envService;
public IConfiguration GetConfiguration()
return new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{EnvService.EnvironmentName}.json", optional: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment