public static ConfigHelperCommon GetCurrentSettings(string Key) { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddEnvironmentVariables(); IConfigurationRoot configuration = builder.Build(); var settings = new ConfigHelperCommon(configuration.GetSection("AppSettings"), Key); return(settings); }
public static string AppSetting(string Key) { _appSettings = GetCurrentSettings(Key); return(_appSettings.appSettingValue); }