public Task <Unit> Handle(DiscardPayment command, CancellationToken cancellationToken) { return(paymentRepository.GetAndUpdate( command.PaymentId, payment => payment.Discard(command.DiscardReason), cancellationToken)); }
public Task Handle(OrderCancelled @event, CancellationToken cancellationToken) { if ([email protected]) { return(Task.CompletedTask); } return(commandBus.Send(DiscardPayment.Create(@event.PaymentId.Value))); }