public IActionResult Index() { var itens = _carrinhoCompra.GetCarrinhoCompraItens(); _carrinhoCompra.CarrinhoCompraItens = itens; var carrinhoCompraViewModels = new CarrinhoCompraViewModels { CarrinhoCompra = _carrinhoCompra, CarrinhoCompraTotal = _carrinhoCompra.GetCarrinhoCompraTotal() }; return(View(carrinhoCompraViewModels)); }
public IViewComponentResult Invoke() { var itens = _carrinhoCompra.GetCarrinhoCompraItens(); //var itens = new List<CarrinhoCompraItem>() { new CarrinhoCompraItem(), new CarrinhoCompraItem() }; _carrinhoCompra.CarrinhoCompraItens = itens; var carrinhoCompraViewModel = new CarrinhoCompraViewModels { CarrinhoCompra = _carrinhoCompra, CarrinhoCompraTotal = _carrinhoCompra.GetCarrinhoCompraTotal() }; return(View(carrinhoCompraViewModel)); }