public AppConfiguration(AppSettings settings) { if (settings == null) throw new ArgumentNullException("AppSettings"); this.BaseUrl = settings.BaseUrl; }
public static AppSettings FromConfiguration() { var instance = new AppSettings(); var configSection = GetConfigSection(); if (configSection != null) { foreach (var prop in configSection.Properties.Cast<ConfigurationProperty>()) { var val = configSection[prop]; instance[prop] = val; } } return instance; }