示例#1
0
        public async Task <IActionResult> Index(string entityName = null, string entityType = null, string keyphrase = null, string query = null, int?programId = null)
        {
            var episodes = await _episodeLister.List(EpisodesListCount, entityName, entityType, keyphrase, query, programId);

            return(View(new HomeIndexViewModel
            {
                SearchQuery = query,
                Episodes = episodes.ToList()
            }));
        }
示例#2
0
        public async Task <List <SrStoredMiniSummarizedEpisode> > List(int count, string entityName = null, string entityType = null, string keyphrase = null, string query = null, int?programId = null)
        {
            var key = (count, entityName, entityType, keyphrase, query, programId);

            if (_memoryCache.TryGetValue(key, out var value) && value is List <SrStoredMiniSummarizedEpisode> valueList)
            {
                return(valueList);
            }

            var episodes = await _episodeLister.List(count, entityName, entityType, keyphrase, query, programId);

            _memoryCache.Set(key, episodes, _cacheTimeout);

            return(episodes);
        }