Exemple #1
0
        public async Task <List <ProductGoodsViewModel> > GetAllProduct()
        {
            var list = new List <ProductGoodsViewModel>();

            list = await _productRespository.GetAllProduct();

            return((list != null) ? list : new List <ProductGoodsViewModel>());
        }
        public IList <Product> GetAllProductIn(int intCatId)
        {
            IList <Product> products;
            string          storageKey = string.Format("product_in_category_id_{0}", intCatId);

            products = _cacheStorage.Retrieve <IList <Product> >(storageKey);

            if (products == null)
            {
                products = _productRespository.GetAllProduct(intCatId);
                _cacheStorage.Store(storageKey, products);
            }

            return(products);
        }