Beispiel #1
0
        public IActionResult Delete(TruthDeleteCommand command)
        {
            var delete = _truthService.Delete(command);

            if (delete.IsError)
            {
                return(BadRequest(delete));
            }
            return(Ok(delete));
        }
Beispiel #2
0
 public ICommandResult Delete(TruthDeleteCommand command)
 {
     try
     {
         var truth = _truthRepository.Read(command.Id);
         _truthRepository.Delete(truth);
         var commandResult = new CommandResult("Verdade deletada com sucesso!", null, false);
         return(commandResult);
     }
     catch (Exception ex)
     {
         var commandResult = new CommandResult($"{ex.InnerException.Message}", null, true);
         return(commandResult);
     }
 }