public Task <Unit> Handle(RecordOrderPayment command, CancellationToken cancellationToken) { return(orderRepository.GetAndUpdate( command.OrderId, order => order.RecordPayment(command.PaymentId, command.PaymentRecordedAt), cancellationToken)); }
public async Task Handle(PaymentFinalized @event, CancellationToken cancellationToken) { await commandBus.Send(RecordOrderPayment.Create(@event.OrderId, @event.PaymentId, @event.FinalizedAt)); }