Пример #1
0
        private IDictionary<Guid, List> GetRelevantItemsList(List<List> contentList, ListsManager manager, ContentLifecycleStatus status)
        {
            Dictionary<Guid, List> result = new Dictionary<Guid, List>();

            ////get all master content items ids
            var contentItemsIds = contentList.Select(cl => cl.Id).ToArray<Guid>();

            if (contentItemsIds.Length > 0)
            {
                ////get all items in the specified status related  to the master items in the list
                var relatedContentItems = manager.GetItems<List>().Where(t => contentItemsIds.Contains(t.OriginalContentId) && t.Status == status);

                foreach (var item in relatedContentItems)
                    result.Add(item.OriginalContentId, item);
            }

            return result.Count > 0 ? result : null;
        }
Пример #2
0
        private IDictionary <Guid, List> GetRelevantItemsList(List <List> contentList, ListsManager manager, ContentLifecycleStatus status)
        {
            Dictionary <Guid, List> result = new Dictionary <Guid, List>();

            ////get all master content items ids
            var contentItemsIds = contentList.Select(cl => cl.Id).ToArray <Guid>();

            if (contentItemsIds.Length > 0)
            {
                ////get all items in the specified status related  to the master items in the list
                var relatedContentItems = manager.GetItems <List>().Where(t => contentItemsIds.Contains(t.OriginalContentId) && t.Status == status);

                foreach (var item in relatedContentItems)
                {
                    result.Add(item.OriginalContentId, item);
                }
            }

            return(result.Count > 0 ? result : null);
        }