public async Task <PaymentResponse> Handle(CreatePaymentCommand request, CancellationToken cancellationToken) { var payment = _mapper.Map <Payment>(request); payment.IsDeleted = false; payment.CreatedBy = _currentUser.UserName; var paymentResponse = _mapper.Map <PaymentResponse>(await _paymentRepository.AddByLoadingReferenceAsync(payment, p => p.Order)); _logger.LogInformation($"Created payment, {JsonSerializer.Serialize(paymentResponse)}."); return(paymentResponse); }