public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { Cart cart = (Cart) controllerContext.HttpContext.Session["Cart"]; if (cart != null) { cart = new Cart(); controllerContext.HttpContext.Session["Cart"] = cart; } return cart; }
public void ProcessOrder(Cart cart, CheckoutViewModel vm) { }
private Cart GetCart() { Cart cart = (Cart)Session["Cart"]; if (cart == null) { cart = new Cart(); Session["Cart"] = cart; } return cart; }
public JsonResult Clear(Cart cart) { cart.Clear(); return Json(""); }