diff --git a/services/payment/src/EShopOnAbp.PaymentService.Application/PaymentRequests/PaymentRequestAppService.cs b/services/payment/src/EShopOnAbp.PaymentService.Application/PaymentRequests/PaymentRequestAppService.cs index 4fd1caa1..d07b7d77 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Application/PaymentRequests/PaymentRequestAppService.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.Application/PaymentRequests/PaymentRequestAppService.cs @@ -46,7 +46,7 @@ namespace EShopOnAbp.PaymentService.PaymentRequests public async Task StartAsync(PaymentRequestStartDto input) { - var paymentRequest = await PaymentRequestRepository.GetAsync(input.PaymentRequestId); + var paymentRequest = await PaymentRequestRepository.GetAsync(input.PaymentRequestId, includeDetails: true); var totalCheckoutPrice = paymentRequest.Products.Sum(s => s.TotalPrice); diff --git a/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs b/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs index 8c1acc3c..8d5cffa7 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs @@ -1,5 +1,8 @@ using EShopOnAbp.PaymentService.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using System; +using System.Linq; +using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -18,5 +21,11 @@ namespace EShopOnAbp.PaymentService.PaymentRequests { } + + public override async Task> WithDetailsAsync() + { + return (await base.WithDetailsAsync()) + .Include(p => p.Products); + } } }