/// <summary> /// Returns the default configuration. /// </summary> /// <returns></returns> internal static EntityGateConfig GetFirstConfig() { lock (locker) { EntityGateConfig rslt = null; if (configs != null) { rslt = configs.FirstOrDefault(); } return(rslt); } }
/// <summary> /// Returns the requested configuration. /// </summary> /// <param name="connectionName">Name of the connection.</param> /// <returns></returns> internal static EntityGateConfig GetConfig(string connectionName) { lock (locker) { EntityGateConfig rslt = null; if (configs != null) { rslt = configs.FirstOrDefault(conf => conf.ConnectionName.EqualsIgnoreCase(connectionName)); } return(rslt); } }
/// <summary> /// Load the configuration. /// </summary> /// <param name="childNode"></param> /// <param name="configProperties"></param> /// <returns></returns> private static EntityGateConfig LoadConfig(XmlNode childNode, PropertyInfo[] configProperties) { var config = new EntityGateConfig(); foreach (var prop in configProperties) { var colNode = childNode.SelectSingleNode(prop.Name); if (colNode != null) { prop.SetValue(config, colNode.InnerText, null); } } return(config); }