public class ManagerConfig
{
private static readonly IHostingEnvironment _hostingEnvironment = ObjectContainer.Current.Resolve<IHostingEnvironment>();
public static string GetManagerConfig(string keyName)
{
var builder = new ConfigurationBuilder()
.SetBasePath(_hostingEnvironment.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{_hostingEnvironment.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
var configuration = builder.Build();
return configuration[keyName].ToString();
}
}