Ejemplo n.º 1
0
        private void SetChildRoutes(PageDirectoryNode parent, List <PageDirectoryNode> allDirectories)
        {
            var childNodes = new List <PageDirectoryNode>();

            foreach (var directory in allDirectories.Where(r => r.ParentPageDirectoryId == parent.PageDirectoryId))
            {
                directory.FullUrlPath         = string.Join("/", parent.FullUrlPath, directory.UrlPath);
                directory.Depth               = parent.Depth + 1;
                directory.ParentPageDirectory = parent;
                childNodes.Add(directory);

                SetChildRoutes(directory, allDirectories);
            }

            parent.ChildPageDirectories = childNodes;
        }
Ejemplo n.º 2
0
        private PageDirectoryNode MapInitial(PageDirectoryTreeNodeQueryModel queryModel)
        {
            var dbDirectory = queryModel.PageDirectory;
            var result      = new PageDirectoryNode()
            {
                Name                  = dbDirectory.Name,
                NumPages              = queryModel.NumPages,
                PageDirectoryId       = dbDirectory.PageDirectoryId,
                ParentPageDirectoryId = dbDirectory.ParentPageDirectoryId,
                UrlPath               = dbDirectory.UrlPath
            };

            result.AuditData = _auditDataMapper.MapCreateAuditData(dbDirectory);

            return(result);
        }