コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #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));
        }
コード例 #4
0
        public Task Handle(PedidoRealizadoEvent notification, CancellationToken cancellationToken)
        {
            _log.AddPassos($"EnviarEmailClienteHandler: PedidoRealizadoEvent");

            return(Task.CompletedTask);
        }