Refactor to eliminate unneeded BasketQueryService

This commit is contained in:
Steve Smith
2021-12-02 16:04:30 -05:00
parent 6f5a6c0860
commit 833dc3bd3a
11 changed files with 69 additions and 65 deletions

View File

@@ -10,6 +10,9 @@ public class Basket : BaseEntity, IAggregateRoot
private readonly List<BasketItem> _items = new List<BasketItem>();
public IReadOnlyCollection<BasketItem> Items => _items.AsReadOnly();
public int TotalItems => _items.Sum(i => i.Quantity);
public Basket(string buyerId)
{
BuyerId = buyerId;

View File

@@ -1,8 +0,0 @@
using System.Threading.Tasks;
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
public interface IBasketQueryService
{
Task<int> CountTotalBasketItems(string username);
}