public Task <Unit> Handle(RealizarPedidoRequest request, CancellationToken cancellationToken)
        {
            _log.AddPassos($"RealizarPedidoHandler -  Id: {request.Id}, Nome: {request.Nome}");

            _log.AddPassos("_mediator.Publish(new PedidoRealizadoEvent());");
            _mediator.Publish(new PedidoRealizadoEvent());

            return(Unit.Task);
        }
        public Task Handle(PedidoRealizadoEvent notification, CancellationToken cancellationToken)
        {
            _log.AddPassos($"EmitirNotaFiscalHandler");

            var r = new Random();

            _log.AddPassos("_mediator.Publish(new NotaFiscalEmitidaEvent());");
            _mediator.Publish(new NotaFiscalEmitidaEvent(new Random().Next(100000, 9999999)));
            return(Task.CompletedTask);
        }
Exemple #3
0
        public async Task <IActionResult> Post([FromBody] RealizarPedidoRequest request)
        {
            _log.AddPassos("_mediator.Send(RealizarPedidoRequest, CancellationToken.None);");
            var result = await _mediator.Send(request, default);

            return(Ok(_log.Passos));
        }
Exemple #4
0
        public Task Handle(PedidoRealizadoEvent notification, CancellationToken cancellationToken)
        {
            _log.AddPassos($"EnviarEmailClienteHandler: PedidoRealizadoEvent");

            return(Task.CompletedTask);
        }