public IEnumerable <Category> GetCategories() { if (!_cache.CheckInCache(AllCategories)) { Func <IEnumerable <Category> > scr = () => _categoryRepository.GetCategories();; _cache.SetInCache(AllCategories, scr); _logger.LogInformation("Set hives in cache"); } return(_cache.ReturnValueByKey(AllCategories)); }
public IEnumerable <Screen> GetScreens() { if (!_cache.CheckInCache(AllScreens)) { Func <IEnumerable <Screen> > scr = () => _screenRepository.GetScreens(); _cache.SetInCache(AllScreens, scr); _logger.LogInformation("Set screens in cache"); } return(_cache.ReturnValueByKey(AllScreens)); }