public async Task <RedirectToActionResult> ClearFromShoppingCart(int bookId) { var selectedBook = GetAllBooks.FirstOrDefault(c => c.BookId == bookId); if (selectedBook != null) { await ClearFromCart(selectedBook); } return(RedirectToAction("Index")); }
public IActionResult ShoppingCartSummary(int bookId) { var selectedBook = GetAllBooks.FirstOrDefault(c => c.BookId == bookId); if (selectedBook != null) { AddToCart(selectedBook, 1); } return(ViewComponent("ShoppingCartSummary")); }