コード例 #1
0
        public async Task RemoveBasketItem(int id)
        {
            var item = await _queries.GetBasketItem(id);

            if (item == null)
            {
                throw new ModelNotFoundException("Basket item not found.");
            }
            var basket = await _queries.GetBasketWithItem(id);

            _unitOfWork.Delete(item);
            await _unitOfWork.PersistChanges();

            _basketCache.Invalidate(basket.Id);
        }