private void RecreateTreeOfProjects(TeamCityProject project, TeamCityProject[] allProjects) { project.SubProjects = allProjects.Where(i => i.ParentProjectId == project.Id).ToList(); foreach (var subProject in project.SubProjects) { RecreateTreeOfProjects(subProject, allProjects); } }
private TeamCityProject[] RecreateTreeOfProjects(TeamCityProject[] allProjects) { var roots = allProjects.Where(i => i.ParentProjectId == null).ToArray(); foreach (var project in roots) { RecreateTreeOfProjects(project, allProjects); } return roots; }