예제 #1
0
 private IEnumerable <ProductListItemViewModel> GetProductsViewModel(IEnumerable <SKUTreeNode> products, string pageAlias)
 {
     return(products.Select(
                product => new ProductListItemViewModel(
                    product,
                    calculationService.CalculatePrice(product.SKU),
                    publicStatusRepository.GetById(product.SKU.SKUPublicStatusID)?.PublicStatusDisplayName,
                    pageUrlRetriever)
     {
         CategoryName = pageAlias
     }));
 }
예제 #2
0
        private IEnumerable <ProductListItemViewModel> GetHotTipProducts()
        {
            var hotTips = hotTipsRepository.GetHotTipProducts(dataRetriever.Retrieve <TreeNode>().Page.NodeAliasPath);

            return(hotTips.Select(
                       product => new ProductListItemViewModel(
                           product,
                           calculationService.CalculatePrice(product.SKU),
                           publicStatusRepository.GetById(product.SKU.SKUPublicStatusID)?.PublicStatusDisplayName,
                           pageUrlRetriever
                           )
                       ));
        }