자주 사용되는 메소드들
자주 사용되는 메소드들
자주 사용되는 메소드들
자주 사용되는 메소드들
public async Task <IOperationResult> HandleAsync(IDeletePayment command, ICorrelationContext context) { var payment = await _paymentsRepository.GetAsync(command.Id); if (payment is null) { throw new BaristaException("payment_not_found", $"Could not find payment with ID '{command.Id}'"); } await _paymentsRepository.DeleteAsync(payment); await _paymentsRepository.SaveChanges(); await _busPublisher.Publish(new PaymentDeleted(command.Id)); return(OperationResult.Ok()); }