示例#1
0
        public static string GetValueOrDefault(string key, string defaultValue = null)
        {
            string ret = null;

            var configurator = new AppSettingConfigurator();

            if (configurator != null)
            {
                ret = configurator.GetCurrent()?.Get(key);
            }

            if (ret == null)
            {
                ret = ConfigurationManager.AppSettings[key];
            }

            return(!string.IsNullOrEmpty(ret) ? ret : defaultValue);
        }
示例#2
0
 public static IConfiguration GetEndointWebServiceGE(this IConfiguration configuration)
 {
     configuration.Put(EndpointWebServiceGE, AppSettingConfigurator.GetValueOrDefault("endpointWebServiceGE"));
     return(configuration);
 }
示例#3
0
 public static string GetCacherPath(this IConfiguration configuration)
 {
     return(AppSettingConfigurator.GetValueOrDefault("mov3r:CacherPath"));
 }