// GET: /<controller>/ public IActionResult Index() { List <ShopingCardItem> shopingCartItems = new List <ShopingCardItem>(); shopingCartItems = _shopingCart.getShopingCardItems(); _shopingCart.ShoppingCardItems = shopingCartItems; ShopingCartViewModel shopingcardviewmodel = new ShopingCartViewModel(); shopingcardviewmodel.ShopingCard = _shopingCart; shopingcardviewmodel.ShopingCardTotal = _shopingCart.GetShopingCardTotal(); return(View(shopingcardviewmodel)); }
public IViewComponentResult Invoke() { //List<ShopingCardItem> listdumy = new List<ShopingCardItem>(); //ShopingCardItem shop = new ShopingCardItem(); //listdumy.Add(shop); //ShopingCardItem shop1 = new ShopingCardItem(); //listdumy.Add(shop1); var shoppingcarditem = _shopingCard.getShopingCardItems(); //var shoppingcarditem = listdumy; _shopingCard.ShoppingCardItems = shoppingcarditem; ShopingCartViewModel shopingCardViewModel = new ShopingCartViewModel(); shopingCardViewModel.ShopingCard = _shopingCard; decimal shopingCardtotal = _shopingCard.GetShopingCardTotal(); shopingCardViewModel.ShopingCardTotal = shopingCardtotal; //shopingCardViewModel.ShopingCardTotal = 0; return(View(shopingCardViewModel)); }