private Dictionary <string, IEnumerable <string> > GetAppConfigSettings(string sysConfigSetName, string appConfigSetName) { // Get the AppSettings DbCommand from the cache - create one if NOT exist in the cache DbCommand dbCmd = _daMgr.DbCmdCacheGetOrAdd(Configuration.Constants.AppSettingCacheName, CreateAppSettingsDbCommand); // Get the system config set name Dictionary <string, IEnumerable <string> > sys = _daMgr.ExecuteReader(dbCmd, null, rdr => CreateAppConfigSettingDictionary(rdr, sysConfigSetName), _daMgr.BuildParamName(Configuration.Constants.ConfigSetName), sysConfigSetName); // Get the application config set name Dictionary <string, IEnumerable <string> > app = _daMgr.ExecuteReader(dbCmd, null, rdr => CreateAppConfigSettingDictionary(rdr, null), _daMgr.BuildParamName(Configuration.Constants.ConfigSetName), appConfigSetName); return(sys.Union(app).ToDictionary(kv => kv.Key, kv => kv.Value)); }
/// <summary> /// Executes the given DbCommand and returns the result. /// If a DbException is raised and a logger class had been provided, /// the method will attempt to Log a debug text version of the dbCommand /// that is backend specific or just log the exception. /// In either case, the exception will be thrown. /// NOTE: /// This function should be avoided and instead caller should use ConsumeReader /// </summary> /// <param name="dbCommand">Database Command Object to execute.</param> /// <returns>Returns a DbDataReader</returns> public IDataReader ExecuteReader(DbCommand dbCommand) { return(_daMgr.ExecuteReader(dbCommand, dbCommand.Transaction, null)); }