public static MoviesDAL.MovieSettings_GetRecord GetSetting(SettingID SettingID) { Dictionary <int, MoviesDAL.MovieSettings_GetRecord> allSettings = MovieSettings.GetAllSettings(); if (allSettings.TryGetValue((int)SettingID, out MoviesDAL.MovieSettings_GetRecord returnValue) == false) { lock (_syncObject) { // Do it again to make sure another thread didn't load it. if (allSettings.TryGetValue((int)SettingID, out returnValue) == false) { returnValue = null; } } } return(returnValue); }
public static string GetSettingValue(SettingID SettingID) { string returnValue = string.Empty; try { MoviesDAL.MovieSettings_GetRecord setting = MovieSettings.GetSetting(SettingID); if (setting != null) { returnValue = setting.Value; } } catch (Exception ex) { // Logging.Logger.LogError ( ex ); throw ex; } return(returnValue); }
public ListSetting GetListByID(SettingID id) { return(this.FirstOrDefault(s => s.ID == id) as ListSetting); }
public NumericSetting GetNumericByID(SettingID id) { return(this.FirstOrDefault(s => s.ID == id) as NumericSetting); }
public Setting GetByID(SettingID id) { return(this.FirstOrDefault(s => s.ID == id)); }