public void RemoveItem(string user, string item)
        {
            WishList confirmedListing = new WishList();

            foreach (WishList listing in db.WishList)
            {
                if (user == listing.UserName && item == listing.Item)
                {
                    confirmedListing = listing;
                }
            }

            db.WishList.Remove(confirmedListing);
            db.SaveChanges();
        }
Example #2
0
        public IActionResult AddWishList(string item, string description, string imageUrl, string url, string price)
        {
            db = new KissListDBContext();


            WishList wishList = new WishList();

            wishList.UserName    = User.Identity.Name;
            wishList.Item        = item;
            wishList.Description = description;
            wishList.ImageUrl    = imageUrl;
            wishList.Url         = url;
            wishList.Price       = price;

            db.WishList.Add(wishList);
            db.SaveChanges();


            return(View("MyWishList", db));
            //return View("index");
        }