Exemple #1
0
        private static void CategoryTest()
        {
            CategoryMenager categoryMenager = new CategoryMenager(new EfCategoryDal());

            foreach (var category in categoryMenager.GetAll().Data)
            {
                Console.WriteLine(category.CategoryName);
            }
        }
        public static List <Category> GetCategoriesFromCache()
        {
            var result = WebCache.Get("category-cache");

            if (result == null)
            {
                CategoryMenager categoryManager = new CategoryMenager();
                result = categoryManager.List();

                WebCache.Set("category-cache", result, 20, true);
            }

            return(result);
        }