Browse Source

Add details to PaymentRequest

pull/48/head
enisn 5 years ago
parent
commit
20a67cf71d
  1. 2
      services/payment/src/EShopOnAbp.PaymentService.Application/PaymentRequests/PaymentRequestAppService.cs
  2. 9
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs

2
services/payment/src/EShopOnAbp.PaymentService.Application/PaymentRequests/PaymentRequestAppService.cs

@ -46,7 +46,7 @@ namespace EShopOnAbp.PaymentService.PaymentRequests
public async Task<PaymentRequestStartResultDto> 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);

9
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<IQueryable<PaymentRequest>> WithDetailsAsync()
{
return (await base.WithDetailsAsync())
.Include(p => p.Products);
}
}
}

Loading…
Cancel
Save