private List <ProductDTO> GetListProducts(bool isAdmin = false) { var re = _cache.Get <List <ProductDTO> >(CacheKey.PRODUCT); if (re == null || re?.Count == 0 || isAdmin == true) { re = _productModel.GetListDTOs(isAdmin); if (re != null && re?.Count > 0) { List <PromProductDTO> proms = _promotionModel.GetListDTOsPromProduct(); if (proms != null || proms?.Count > 0) { _productModel.AttachDiscount(ref re, proms); } _cache.Set(re, CacheKey.PRODUCT); } } return(re); // return isAdmin ? re : re.Where(item => item.isShow == true).ToList(); }