Пример #1
0
        public List <ProductListModel> ProductListModel()
        {
            var list = new List <ProductListModel>();

            foreach (var item in products)
            {
                ProductImage pi = productImageRepo.FirstByProductId(item.ProductId);
                list.Add(new ProductListModel(item, pi));
            }
            return(list);
        }
        public ShowcaseProductListModel ShowcaseProductListModel()
        {
            ShowcaseProductListModel model = new ShowcaseProductListModel();

            model.ShowcaseProduct = showcaseproducts.ToList();
            model.Showcase        = showcaseRepository.GetAll();
            model.Product         = productRepository.GetAll();
            List <ProductImage> listProductImage = new List <ProductImage>();

            foreach (var item in model.Product)
            {
                ProductImage productimage = productImageRepository.FirstByProductId(item.ProductId);
                listProductImage.Add(productimage);
            }
            model.ProductImage = listProductImage;
            return(model);
        }