protected override async Task Handle(TCommand request, CancellationToken cancellationToken)
        {
            var resultadoValidacao = _validatorService.Validate(request);

            if (!resultadoValidacao.IsValid)
            {
                throw new DomainException(
                          $"Command Validation Errors for type {typeof(TCommand).Name}",
                          new ValidationException("Validation exception", resultadoValidacao.Errors));
            }

            await HandleCore(request, cancellationToken);
        }
        private void OnSend()
        {
            if (SelectedPrinter != null && _printerControllerService.IsConnected)
            {
                var data = CommandText;
                if (_commandsDefinitionLoaderService != null)
                {
                    var commandDefinition = _commandsDefinitionLoaderService.CommandDefinitions.GetFromCommandText(data);
                    if (commandDefinition != null)
                    {
                        _commandValidator.Validate(
                            commandDefinition,
                            data);
                    }
                }

                CommandText = string.Empty;
                _printerControllerService.Write(
                    $"{data}\n",
                    Encoding.ASCII);
                CommandHistory.Add(data);
                _historyIndex = 0;
            }
        }