public ICommandResult Handle(DeleteGenderCommand command) { if (command.Id.ToString().Length == 0) { AddNotification("Id", "Identificador inválido!"); } if (Invalid) { return(new CommandResult(false, "Erro ao deletar gênero!", Notifications)); } bool result = _repository.Delete(command.Id); if (!result) { return(new CommandResult(false, "Erro ao deletar gênero!", Notifications)); } return(new CommandResult(true, "Gênero deletado com sucesso!")); }
public ICommandResult Delete(DeleteGenderCommand command) { return(_handler.Handle(command)); }