public ActionResult AddBook(int bookId) { BookDbContext bookDbContext = new BookDbContext(); Book book = bookDbContext.Books.Find(bookId); MyCart cart = MyCart.GetCart(); int result; if (book != null) { result = cart.AddBook(book); } return(RedirectToAction("Index")); }