示例#1
0
        public async Task <RedirectToActionResult> ClearFromShoppingCart(int bookId)
        {
            var selectedBook = GetAllBooks.FirstOrDefault(c => c.BookId == bookId);

            if (selectedBook != null)
            {
                await ClearFromCart(selectedBook);
            }

            return(RedirectToAction("Index"));
        }
示例#2
0
        public IActionResult ShoppingCartSummary(int bookId)
        {
            var selectedBook = GetAllBooks.FirstOrDefault(c => c.BookId == bookId);

            if (selectedBook != null)
            {
                AddToCart(selectedBook, 1);
            }

            return(ViewComponent("ShoppingCartSummary"));
        }