public async Task <int> AddExceptionLogItem(ExceptionLogItem exceptionLogItem) { try { exceptionLogItem = (await _exceptionLogItemContext.AddAsync(exceptionLogItem)).Entity; await _exceptionLogItemContext.SaveChangesAsync(); return(exceptionLogItem.Id); } catch (Exception) { return(int.MinValue); } }
public ExceptionLogItem CreateExceptionLogItem(Guid categoryGuid, Guid eventGuid, Guid severityGuid, Guid incident, Exception exception) { ExceptionLogItem newExceptionLogItem = new ExceptionLogItem() { Id = FindLastLogId(), Category = categoryGuid, Event = eventGuid, Severity = severityGuid, Incident = incident, Exception = exception }; LogItemz.Add(newExceptionLogItem); return newExceptionLogItem; }