public List <SearchResult> GetSearchResultsForTerm(string searchTerm) { var cacheKey = $"{_searchEngine.Name}:{searchTerm}"; if (!_memoryCache.TryGetValue <List <SearchResult> >(cacheKey, out var cachedValue)) { cachedValue = _searchEngine.GetSearchResultsForTerm(searchTerm); _memoryCache.Set(cacheKey, cachedValue, new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromHours(1))); } return(cachedValue); }