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); }
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)); }
public Task Handle(PedidoRealizadoEvent notification, CancellationToken cancellationToken) { _log.AddPassos($"EnviarEmailClienteHandler: PedidoRealizadoEvent"); return(Task.CompletedTask); }