public ActionResult AddBasket(int id) // ProductId { Product product = db.Products.FirstOrDefault(m => m.ProductId == id); Customer customer = Session["loginKey"] as Customer; db.BasketOfCustomers.Add(new BasketOfCustomer() { CustomerId = customer.CustomerId, ProductId = product.ProductId, CreatedDate = DateTime.Now }); db.SaveChanges(); return(RedirectToAction("Index", "Home")); }
private void SaveChanges() { _shoesDataEntities.SaveChanges(); }