public static moduleModel.Outline ToWebModel(this moduleModel.Outline outline)
        {
            var result = new moduleModel.Outline();

            result.Items = new List <moduleModel.OutlineItem>();
            foreach (var outlineItem in outline.Items)
            {
                var newOutlineItem = new moduleModel.OutlineItem();
                newOutlineItem.Id = outlineItem.Id;
                newOutlineItem.HasVirtualParent = outlineItem.HasVirtualParent;
                newOutlineItem.SeoObjectType    = outlineItem.SeoObjectType;
                if (outlineItem.SeoInfos != null)
                {
                    newOutlineItem.SeoInfos = outlineItem.SeoInfos.Select(x => new SeoInfo {
                        IsActive = x.IsActive, LanguageCode = x.LanguageCode, SemanticUrl = x.SemanticUrl, StoreId = x.StoreId
                    }).ToList();
                }
                result.Items.Add(newOutlineItem);
            }
            return(result);
        }
        protected virtual IEnumerable<string> ExpandOutline(Outline outline)
        {
            // Outline structure: catalog/category1/.../categoryN/product

            var items = outline.Items
                .Take(outline.Items.Count - 1) // Exclude last item, which is product ID
                .Select(i => i.Id)
                .ToList();

            var catalogId = items.First();

            var result = new List<string>
            {
                catalogId,
                string.Join("/", items)
            };

            // For each child category create a separate outline: catalog/child_category
            if (items.Count > 2)
            {
                result.AddRange(
                    items.Skip(1)
                    .Select(i => string.Join("/", catalogId, i)));
            }

            return result;
        }