public Task <Unit> Handle(TimeOutPayment command, CancellationToken cancellationToken) { return(paymentRepository.GetAndUpdate( command.PaymentId, payment => payment.TimeOut(), cancellationToken)); }
public async Task <IActionResult> TimeoutPayment(Guid id, [FromBody] TimeOutPaymentRequest?request) { var command = TimeOutPayment.Create( id, request?.TimedOutAt ); await commandBus.Send(command); return(Ok()); }