コード例 #1
0
ファイル: CatalogController.cs プロジェクト: CCSW/desnivell
        public ActionResult HomepageProducts(int? productThumbPictureSize)
        {
            var model = new HomePageProductsModel()
            {
                UseSmallProductBox = _catalogSettings.UseSmallProductBoxOnHomePage
            };
            model.Products = _productService.GetAllProductsDisplayedOnHomePage()
                .Select(x => PrepareProductOverviewModel(x, !_catalogSettings.UseSmallProductBoxOnHomePage, true, productThumbPictureSize))
                .ToList();

            return PartialView(model);
        }
コード例 #2
0
        public ActionResult HomepageProducts(int? productThumbPictureSize)
        {
            var products = _productService.GetAllProductsDisplayedOnHomePage();
            //ACL
            products = products.Where(p => _aclService.Authorize(p)).ToList();

            var model = new HomePageProductsModel()
            {
                UseSmallProductBox = _catalogSettings.UseSmallProductBoxOnHomePage,
                Products = PrepareProductOverviewModels(products,
                    !_catalogSettings.UseSmallProductBoxOnHomePage, true, productThumbPictureSize)
                    .ToList()
            };

            return PartialView(model);
        }