private void AddChildren(PagePath pagePath, string pageUri, SiteMapNode currentMapNode, WikiPageTreeNode currentTreeNode, IEnumerable<WikiPageTreeNode> completeTree) { foreach (var childTreeNode in completeTree.Where(x => x.ParentLinage == currentTreeNode.Lineage)) { var child = new SiteMapNode(childTreeNode.Page.Title, childTreeNode.Path, childTreeNode.CreateLink(pageUri), childTreeNode.CreateLinksForPath(pageUri)); if (child.Path.Equals(pagePath)) child.IsCurrent = true; currentMapNode.AddChild(child); AddChildren(pagePath, pageUri, child, childTreeNode, completeTree); } }