private config.Environment GetEnvironment() { try { config.Environment returnValue = null; String environmentName = ConfigurationManager.AppSettings.Get("ENVIRONMENT"); if (!String.IsNullOrEmpty(environmentName)) { EnvironmentsSection environmentsSection = (EnvironmentsSection)ConfigurationManager.GetSection("environments"); List <config.Environment> environments = new List <config.Environment>(environmentsSection.Environments); returnValue = environments.Find(x => x.Name == environmentName); } return(returnValue); } catch (Exception e) { throw e; } }
static ExternalIHelperConfigSettingsFactory() { config = (EnvironmentsSection)ConfigurationManager.GetSection("ExternalIHelperEnvironments"); }