protected virtual async Task <IActionResult> ShowListByTagAsync(string tagNames, int page) { if (string.IsNullOrEmpty(tagNames)) { return(BadRequest()); } var titles = tagNames.Split("+").Select(t => t.ToLowerInvariant()).ToArray(); var tags = await TagsRepository.GetAllAsync(q => q.Where(t => titles.Contains(t.Title.ToLower()))); if (!tags.items.Any()) { return(PageNotFound()); } var(items, itemsCount) = await Repository.GetAllWithBlocksAsync(async entities => (await ConfigureQueryAsync(entities, page)).WithTags(tags.items).Where(e => e.IsPublished)); return(View("List", new ListViewModel <Post <TUserPk> >(GetPageContext(), items, itemsCount, Page, ItemsPerPage) { Tags = tags.items })); }