public ActionResult Index()
        {
            HomePageView homePageView = new HomePageView();

            homePageView.Categories = base.GetCategories();
            GetFeaturedProductsResponse response =
                _productCatalogService.GetFeaturedProducts();

            homePageView.Products = response.Products;
            return(View(homePageView));
        }
Exemplo n.º 2
0
        public ActionResult <HomePageView> Index()
        {
            var homePageView = new HomePageView();

            homePageView.Categories    = base.GetCategories();
            homePageView.BasketSummary = base.GetBasketSummaryView();

            GetFeaturedProductsResponse response =
                _productCatalogService.GetFeaturedProducts();

            homePageView.Products = response.Products;

            return(homePageView);
        }
Exemplo n.º 3
0
        public GetFeaturedProductsResponse GetFeaturedProducts()
        {
            lock (_getTopSellingProductsLock)
            {
                GetFeaturedProductsResponse      response     = new GetFeaturedProductsResponse();
                IEnumerable <ProductSummaryView> productViews = _cacheStorage.Retrieve <IEnumerable <ProductSummaryView> >(CacheKeys.TopSellingProducts.ToString());

                if (productViews == null)
                {
                    response = _productCatalogService.GetFeaturedProducts();

                    _cacheStorage.Store(CacheKeys.TopSellingProducts.ToString(), response.Products.ToList());
                }
                else
                {
                    response.Products = productViews;
                }

                return(response);
            }
        }