public async Task <IActionResult> Post(CreateFornecedorCommand command)
        {
            try
            {
                await fornecedorApplicationService.Add(command);

                return(Ok(new { Message = "Fornecedor cadastrado com sucesso." }));
            }
            catch (ValidationException e)
            {
                return(BadRequest(ValidationAdapter.Parse(e.Errors)));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }
        }
        public async Task <IActionResult> Create(FornecedorViewModel fornecedor)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(View(fornecedor));
            }

            var commandResult = await _fornecedorApplicationService.Add(fornecedor);

            if (commandResult.Success)
            {
                NotifyCommandResultSuccess();
                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                NotifyCommandResultErrors(commandResult.Errors);
            }

            return(View(fornecedor));
        }