public static void AddTrustFactorLog(TrustFactorLog log) { lock (trustFactorLogLock) { trustFactorLogs.Add(log); } }
public TrustFactorLog Add(TrustFactorLog trustFactorLog, int callerId) { using (UBContext ubc = new UBContext()) { try { ubc.Add(trustFactorLog); ubc.SaveChanges(); return(trustFactorLog); } catch (Exception ex) { Utils.Logging.AddLog(new SystemLog() { LoggerName = "Unifiedban", Date = DateTime.Now, Function = "Unifiedban.Data.TrustFactorLogService.Add", Level = SystemLog.Levels.Warn, Message = ex.Message, UserId = callerId }); if (ex.InnerException != null) { Utils.Logging.AddLog(new SystemLog() { LoggerName = "Unifiedban.Data", Date = DateTime.Now, Function = "Unifiedban.Data.TrustFactorLogService.Add", Level = SystemLog.Levels.Warn, Message = ex.InnerException.Message, UserId = callerId }); } } return(null); } }