public void SetCategoryList(object category = null) { if (!_cacheManager.IsSet("CategoriList_")) { _cacheManager.Add("CategoriList_", _categoryRepository.GetMany(x => x.ParentCategoryId == 0).ToList(), 3600); } var categoryList = _cacheManager.Get <List <Category> >("CategoriList_"); ViewBag.CategoryList = categoryList; }