public ViewResult Index()
        {
            var tours = _tourCart.GetShoppedTours();

            _tourCart.ShoppedTours = tours;

            var cartViewModel = new TourCartViewModel
            {
                TourCart  = _tourCart,
                CartTotal = _tourCart.GetCartTotal()
            };

            return(View(cartViewModel));
        }
Beispiel #2
0
        public IViewComponentResult Invoke()
        {
            var tours = _tourCart.GetShoppedTours();

            //mock data
            // var tours = new List<ShoppedTour>()
            //             {
            //                 new ShoppedTour(),
            //                 new ShoppedTour()
            //             };
            _tourCart.ShoppedTours = tours;

            var tourCartViewModel = new TourCartViewModel
            {
                TourCart  = _tourCart,
                CartTotal = _tourCart.GetCartTotal()
            };

            return(View(tourCartViewModel));
        }