Ejemplo n.º 1
0
        public static List <Category> GetCategoriesFromCache()
        {
            var result = WebCache.Get("category-cache") as List <Category>;

            if (result == null)
            {
                CategoriesManager categoryManager = new CategoriesManager();
                result = categoryManager.List();
                WebCache.Set("category-cache", result, 20, true);
            }

            return(result);
        }
Ejemplo n.º 2
0
 public ActionResult Index()
 {
     return(View(categoriesManager.List()));
 }