public ActionResult Index() { HomePageView homePageView = new HomePageView(); homePageView.Categories = base.GetCategories(); GetFeaturedProductsResponse response = _productCatalogService.GetFeaturedProducts(); homePageView.Products = response.Products; return(View(homePageView)); }
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); }
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); } }