public async Task <IActionResult> GetAll([FromQuery] Filters filters) { var cacheKey = new FiltersCacheKey(filters); var newsItems = Cache.Get <IEnumerable <NewsFeedItem> >(cacheKey); if (newsItems == null) { newsItems = await _newsFeedService.Get(null, filters); Cache.Set(cacheKey, newsItems, new CancellationChangeToken(_cancellationTokenSource.Token)); } return(Ok(newsItems)); }
protected bool Equals(FiltersCacheKey other) { return(Equals(Body, other.Body) && Equals(AuthorNames, other.AuthorNames) && Equals(Title, other.Title)); }