public async Task <Domain.Model.Configuration.Configuration> GetConfiguration(ConfigurationKey configurationKey)
 {
     try
     {
         return(await Configuration
                .SingleOrDefaultAsync(config => config.Key == configurationKey.ToString()));
     }
     catch (Exception) { throw; }
 }
        public static string GetSetting(ConfigurationKey key)
        {
            string keyString = key.ToString();

            var value = GetConfigFromConfigFile(keyString);

            if (value == null)
            {
                throw new ArgumentOutOfRangeException("key", string.Format("Cannot find setting with key {0}", keyString));
            }

            return(value);
        }
Beispiel #3
0
 /// <summary>
 /// Gets the string value.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <returns>
 /// The value
 /// </returns>
 private string GetStringValue(ConfigurationKey key)
 {
     return(this.GetStringValue(key.ToString()));
 }
        public ConfigurationSettings GetConfigurationSettings(ClxApplication application, ConfigurationKey key)
        {
            switch (key)
            {
            case ConfigurationKey.CLXD:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "1xaOn6Ot6HRjXbIPl7E2WJ3Bs9SmWpEy",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "c5oa+iWxTPs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "q7wvRn4eb3cRrLvSkAHG8w==",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXD2:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "5HYH35IsmBLxuFKgDA0deV4cSI9w/aeE",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "c5oa+iWxTPs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "zZCXW9Ci9FGVpj7+YIrMdxtI3uI0kDL1",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXD3:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "5HYH35IsmBLxuFKgDA0deV4cSI9w/aeE",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "c5oa+iWxTPs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "tN2vG1Y6pleVpj7+YIrMdxtI3uI0kDL1",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXI:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "5HYH35IsmBLxuFKgDA0deV4cSI9w/aeE",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "c5oa+iWxTPs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "7GS8RS4GC4MRrLvSkAHG8w==",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXP:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "bIyV3M7QftbxuFKgDA0deV4cSI9w/aeE",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "07s4aRvDFLs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "ZisF3qmLAEMRrLvSkAHG8w==",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXPG:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "WTzPYAETxojxuFKgDA0deV4cSI9w/aeE",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "c5oa+iWxTPs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "xWlbtRgC7x+Vpj7+YIrMdxtI3uI0kDL1",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXPP:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "UzeafzXCKVFUiOK4kbZnXSPfSmxEso8X7kK+s12DlYA=",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "qHuK02GJ/XY=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "OFifF/KYo4eVpj7+YIrMdxtI3uI0kDL1",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXQ:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "bYtNZ/PbgPkj30psRLKPF+5CvrNdg5WA",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "07s4aRvDFLs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "7fOnJxxDY7oRrLvSkAHG8w==",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXR2:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "O2krnbvpiHLxuFKgDA0deV4cSI9w/aeE",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "c5oa+iWxTPs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "aEa/5aTGcl2Vpj7+YIrMdxtI3uI0kDL1",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXT:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "bYtNZ/PbgPkj30psRLKPF+5CvrNdg5WA",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "07s4aRvDFLs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "BBBxdZodCA0RrLvSkAHG8w==",
                    PawnSecDBUser = "******"
                });

            case ConfigurationKey.CLXT2:
                return(new ConfigurationSettings()
                {
                    DstrProdEnv = key.ToString().ToUpper(),
                    PawnSecDBHost = "bYtNZ/PbgPkj30psRLKPF+5CvrNdg5WA",
                    PawnSecDBPassword = "******",
                    PawnSecDBPort = "07s4aRvDFLs=",
                    PawnSecDBSchema = "Ny2VIxVYqnA=",
                    PawnSecDBService = "Ny/sG2mylyCVpj7+YIrMdxtI3uI0kDL1",
                    PawnSecDBUser = "******"
                });

            default: throw new BuildException("Configuration Settings not implemented: " + application + " - " + key);
            }
        }
Beispiel #5
0
 Task <string> GetAsync(ConfigurationKey configurationKey, string defaultValue) =>
 Task.FromResult(_configuration.Value.GetSection("configuration")[configurationKey.ToString()] ?? defaultValue);
 // <inheritdoc>
 public string Get(ConfigurationKey key)
 {
     return(ConfigurationManager.AppSettings[key.ToString()]);
 }