public async Task <bool> Handle(IntegrationEventNotification <PriceCalculatedIntegrationEvent> notification, CancellationToken cancellationToken)
        {
            var command = new UpdatePriceCommand(notification.Data.OrderId, notification.Data.Total);

            var identifiedCommand = new IdentifiedCommand <UpdatePriceCommand, bool>(command, notification.Data.Id);

            return(await _mediator.Send(identifiedCommand, cancellationToken));
        }
Ejemplo n.º 2
0
 public async Task Update(UpdatePriceCommand command)
 {
     await CommandBus.Execute(command);
 }
Ejemplo n.º 3
0
 public IActionResult Put([FromServices] UpdatePriceHandler handler, UpdatePriceCommand request)
 {
     handler.Handle(request);
     return(Ok());
 }
Ejemplo n.º 4
0
        public async Task <ActionResult <Unit> > Update(int sportObjectId, int priceId, UpdatePriceCommand command)
        {
            command.SportObjectId = sportObjectId;
            command.PriceId       = priceId;

            return(await Mediator.Send(command));
        }