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); } }
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); } }
public IHttpActionResult Query(SystemLogQuery query) { var logs = _logService.GetSystemLogEntries(query); return(Ok(logs)); }