public static IQuery ToDbQuery(this SystemLogClearCommand command) { if (command == null) { throw new ArgumentNullException("command"); } return(DbQuery.For <SystemLogEntry>().FilterBy(x => command.Ids.Contains(x.Id))); }
public UserMessage ClearSystemLog(SystemLogClearCommand command) { EnsureIsValid(command); try { var deleted = _db.LogEntries.Delete(command.ToDbQuery()); Commit(); return(UserMessage.ResourceFormat(() => Messages.SystemLogClearSuccess, deleted)); } catch (Exception ex) { throw new ServiceException("Cannot clear system log entries.", ex); } }
public IHttpActionResult Clear(SystemLogClearCommand command) { var message = _logService.ClearSystemLog(command); return(Ok(message)); }