private IEnumerable <IFeedItem> SortForFeed(IEnumerable <IFeedItem> items, Enum type)
        {
            var sortedItems = _centralFeedHelper.Sort(items, type);

            return(sortedItems.OrderByDescending(el => el.IsPinActual)
                   .ToArray());
        }
Exemplo n.º 2
0
        public void Map(LatestActivitiesPanelModel node, LatestActivitiesPanelViewModel viewModel)
        {
            var centralFeedType = _feedTypeProvider[node.ActivityType.Value.Id];

            var allItems      = _centralFeedHelper.GetCentralFeedItems(centralFeedType).ToList();
            var filteredItems = FilterLatestActivities(allItems).Take(node.CountToDisplay.Value);
            var sortedItems   = _centralFeedHelper.Sort(filteredItems, centralFeedType).Select(Convert).ToList();

            viewModel.Feed             = sortedItems;
            viewModel.ShowSeeAllButton = sortedItems.Count < allItems.Count;
        }