Exemple #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);
     }
 }
Exemple #2
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);
     }
 }