8.2 Building the Shopping Cart; Listing 8-16 The Index Action Method in the CartController.cs File
This commit is contained in:
parent
4436c60e79
commit
b64c59264b
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using SportsStore.WebUI.Models;
|
||||
|
||||
namespace SportsStore.WebUI.Controllers
|
||||
{
|
||||
@ -17,6 +18,15 @@ namespace SportsStore.WebUI.Controllers
|
||||
repository = repo;
|
||||
}
|
||||
|
||||
public ViewResult Index(string returnUrl)
|
||||
{
|
||||
return View(new CartIndexViewModel
|
||||
{
|
||||
Cart = GetCart(),
|
||||
ReturnUrl = returnUrl
|
||||
});
|
||||
}
|
||||
|
||||
// GET: Cart
|
||||
public RedirectToRouteResult AddToCart(int productId, string returnUrl)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user