Ejemplo n.º 1
0
 public UserMessage ClearSystemLog(SystemLogQuery query)
 {
     EnsureIsValid(query);
     try
     {
         var deleted = _db.LogEntries.Delete(query.ToDbQuery<SystemLogEntry>());
         Commit();
         return UserMessage.ResourceFormat(() => Messages.SystemLogClearSuccess, deleted);
     }
     catch (Exception ex)
     {
         throw new ServiceException("Cannot clear system log entries.", ex);
     }
 }
Ejemplo n.º 2
0
 public IHttpActionResult Query(SystemLogQuery query)
 {
     var logs = _logService.GetSystemLogEntries(query);
     return Ok(logs);
 }
Ejemplo n.º 3
0
 public IList<SystemLogEntryBriefModel> GetSystemLogEntries(SystemLogQuery query)
 {
     EnsureIsValid(query);
     try
     {
         var entries = _db.LogEntries.ProjectThenQuery<SystemLogEntryBriefModel>(
             query.ToDbQuery<SystemLogEntryBriefModel>());
         return entries;
     }
     catch (Exception ex)
     {
         throw new ServiceException("Cannot get system log entries.", ex);
     }
 }