示例#1
0
        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);
            }
        }
示例#2
0
        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;
        }