コード例 #1
0
 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)));
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        public IHttpActionResult Clear(SystemLogClearCommand command)
        {
            var message = _logService.ClearSystemLog(command);

            return(Ok(message));
        }