public Task Handle(PagamentoRecusadoEvent message) { //_bus.Send(new CancelarPedidoCommand { AggregateRoot = message.AggregateRoot }).Wait(); // Realiza processamento de negocio! Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Pagamento Recusado!"); Console.ForegroundColor = ConsoleColor.Black; _bus.Publish(new PedidoCanceladoEvent() { AggregateRoot = message.AggregateRoot }).Wait(); Data.PagamentoRealizado = false; ProcessoSaga(); return(Task.CompletedTask); }
public async Task Handle(PagamentoRecusadoEvent message, CancellationToken cancellationToken) { await _mediatorHandler.EnviarComando(new CancelarProcessamentoPedidoEstornarEstoqueCommand(message.PedidoId, message.ClienteId)); }
public async Task Handle(PagamentoRecusadoEvent mensagem, CancellationToken cancellationToken) { await _mediatorHandler.EnviarComando(new CancelarPedidoCommand(mensagem.PedidoID, mensagem.ClienteID)); }