public async Task <IActionResult> Items(int feedId) { var feed = await feedRepository.GetFeedById(feedId); if (feed == null) { this.AddFrontendMessage(Web.ViewModels.Shared.MessageStatus.Danger, "Feed not found"); return(RedirectToAction("Index", "Explore")); } var model = new FeedItemsViewModel(); model.FeedId = feedId; model.FeedName = feed.Name; model.Items = await feedRepository .GetItems(feedId) .ProjectTo <FeedItemViewModel>(configurationProvider) .OrderByDescending(i => i.CreatedAt) .ToListAsync(); return(View(model)); }
public async Task <FeedModel> GetFeed(Guid idFeed) { return(await feedsRepository.GetFeedById(idFeed)); }