コード例 #1
0
 public Task <Unit> Handle(DiscardPayment command, CancellationToken cancellationToken)
 {
     return(paymentRepository.GetAndUpdate(
                command.PaymentId,
                payment => payment.Discard(command.DiscardReason),
                cancellationToken));
 }
コード例 #2
0
        public Task Handle(OrderCancelled @event, CancellationToken cancellationToken)
        {
            if ([email protected])
            {
                return(Task.CompletedTask);
            }

            return(commandBus.Send(DiscardPayment.Create(@event.PaymentId.Value)));
        }