manage basket checkout after login (#371)
This commit is contained in:
1 parent
fdb4869c0b
commit
516d87aaa1
5 files changed
+25
-7
No files matched your search
@@ -5,6 +5,7 @@ using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||
using System.Collections.Generic;
|
||||
using Ardalis.GuardClauses;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Specifications;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Services
|
||||
{
|
||||
@@ -28,7 +29,9 @@ namespace Microsoft.eShopWeb.ApplicationCore.Services
|
||||
|
||||
public async Task CreateOrderAsync(int basketId, Address shippingAddress)
|
||||
{
|
||||
var basket = await _basketRepository.GetByIdAsync(basketId);
|
||||
var basketSpec = new BasketWithItemsSpecification(basketId);
|
||||
var basket = await _basketRepository.FirstOrDefaultAsync(basketSpec);
|
||||
|
||||
Guard.Against.NullBasket(basketId, basket);
|
||||
var items = new List<OrderItem>();
|
||||
foreach (var item in basket.Items)
|
||||
|
||||
Reference in new issue
Block a user