public static bool TryGetValue <T>(this IAppConfiguration config, Type section, Type type, string key, out T value) { var configItem = $"{section.Name}.{type.FullName}.{key}"; if (config.Contains(configItem) == true) { try { if (ConfigurationBase.CanSupportType(typeof(T)) == true) { value = (T)ConfigurationBase.ConvertFromConfig(config[configItem], typeof(T)); return(true); } else { throw new NotSupportedException($"{typeof(T).Name} does not supported."); } } catch { } } value = default; return(false); }