public IActionResult Delete(TruthDeleteCommand command) { var delete = _truthService.Delete(command); if (delete.IsError) { return(BadRequest(delete)); } return(Ok(delete)); }
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); } }