Refactor to eliminate unneeded BasketQueryService
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||
|
||||
public interface IBasketQueryService
|
||||
{
|
||||
Task<int> CountTotalBasketItems(string username);
|
||||
}
|
||||
Reference in New Issue
Block a user