public async Task Executar(ExcluirLivroEntrada entrada) { if (entrada is null) { this._ExcluirLivroSaidaPort.WriteError("Entrada não pode ser nula"); return; } ICadastroLivro CadastroLivro = await this._CadastroLivroRepository.GetCadastroLivro().ConfigureAwait(false); if (CadastroLivro is null) { this._ExcluirLivroSaidaPort.WriteError("Cadastro de livros não existe."); return; } ILivro livro = await this._CadastroLivroService.ExcluirLivro(CadastroLivro, new Livro() { isbn = entrada.isbn, }); await this._unitOfWork.Save().ConfigureAwait(false); this.BuildOutput(livro.isbn.id); }
public Object Delete(string isbn) { var result = new ExcluirLivroEntrada(isbn); /* mediator não funciona na minha versão de VSS2017 pq precisa de .net core acima de 2.1 */ /* * await mediator.PublishAsync(result) * .ConfigureAwait(false); */ return(result); }
public async Task <IActionResult> Delete( [FromServices] CadastrarLivroPresenter presenter, [FromForm] CadastrarLivroRequest request) { var inputmediator = new ExcluirLivroEntrada(request.isbn); /* mediator não funciona na minha versão de VSS2017 pq precisa de .net core acima de 2.1 */ /* * await mediator.PublishAsync(inputmediator) * .ConfigureAwait(false); */ return(presenter.ViewModel); }