public async Task <IEnumerable <INewsItem> > Get( [FromQuery] int maxResults, [FromQuery] string excludedSources) { var excludedSourcesArray = DeserializeExcludedSources(excludedSources); return(await _database.GetAsync(maxResults, excludedSourcesArray)); }
private async Task<IEnumerable<NewsItemEntity>> GetNewItems() { IEnumerable<INewsItem> news = await GetNews(); IEnumerable<INewsItem> currentNews = await _database.GetAsync(); return news .Where(item => !WasItemAdded(currentNews, item)) .Select(item => new NewsItemEntity(item)); }