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)); }
public async Task Update(UpdatePriceCommand command) { await CommandBus.Execute(command); }
public IActionResult Put([FromServices] UpdatePriceHandler handler, UpdatePriceCommand request) { handler.Handle(request); return(Ok()); }
public async Task <ActionResult <Unit> > Update(int sportObjectId, int priceId, UpdatePriceCommand command) { command.SportObjectId = sportObjectId; command.PriceId = priceId; return(await Mediator.Send(command)); }