public async Task <ActionResult <List <SearchResultsViewModel> > > DoSearch(string query) { var podcastResults = await _podcastRepository .GetAll() .Where(p => p.AppUser.Id == _applicationUser.Id) .Where(p => p.Title.Contains(query) || p.Description.Contains(query)) .Select(p => new SearchResultsViewModel { Title = p.Title, Description = HtmlUtils.FormatLineBreaks(p.Description).Truncate(100, true), ImageUrl = p.GetImageUrl(_storageSettings.CdnUrl, _imageFileStorageSettings.ContainerName), Url = p.Slug, Type = "Podcast", DateCreated = p.CreateDate }).ToListAsync(); var entryResults = await _entryRepository .GetAll() .Include(x => x.Podcast) .Where(p => p.Podcast.AppUser.Id == _applicationUser.Id) .Where(p => p.Title.Contains(query) || p.Description.Contains(query)) .Select(p => new SearchResultsViewModel { Title = p.Title, Description = HtmlUtils.FormatLineBreaks(p.Description).Truncate(100, true), ImageUrl = p.GetImageUrl(_storageSettings.CdnUrl, _imageFileStorageSettings.ContainerName), Url = p.Podcast.Slug, Type = "Entry", DateCreated = p.CreateDate }).ToListAsync(); var mergedResults = podcastResults.Union(entryResults); return(Ok(mergedResults)); }