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); }
public async Task <WishlistBook> GetWishlistBookAsync(int id) { if (id < 0) { throw new Exception("Id cannot be less than 0"); } return(await _repository.GetAsync(id)); }