public IEnumerable<Product_LookUp_MostViewedProductList_Result> GetProductListByMostViewedProducts(bool useCache)
{
if (useCache)
{
if (_cache.Contains(CacheItemKeys.MostViewedProduct))
{
var model = _cache.Get<IEnumerable<Product_LookUp_MostViewedProductList_Result>>(CacheItemKeys.MostViewedProduct);
}
else
{
var mostviewedproductlist = _unitOfWork.Product_LookUp_MostViewedProductListRepository.ExecWithStoreProcedure("Product_LookUp_MostViewedProductList");
return mostviewedproductlist;
};
}
4) In controller Action
public ActionResult UCHomeProductByMostViewed()
{
var mostviewedmodel = _productService.GetProductListByMostViewedProducts(true).ToList();
return View(mostviewedmodel);
}
Share This with your friend by choosing any social account