Example #1
0
        public async Task RemoveItem(int wishlistId, int productId)
        {
            var spec     = new WishlistWithItemsSpecification(wishlistId);
            var wishlist = (await _wishlistRepository.GetAsync(spec)).FirstOrDefault();

            wishlist.RemoveItem(productId);
            await _wishlistRepository.UpdateAsync(wishlist);
        }
Example #2
0
        public async Task <WishlistBook> GetWishlistBookAsync(int id)
        {
            if (id < 0)
            {
                throw new Exception("Id cannot be less than 0");
            }

            return(await _repository.GetAsync(id));
        }