public void ComputePaths(ProcessStep root, List <ProcessStep> nodeList) { var tNodeList = new List <ProcessStep>(); tNodeList.AddRange(nodeList); tNodeList.Add(root); if (root.Children != null && root.Children.Any() && recursiveCount <= 100) { recursiveCount++; foreach (var child in root.Children) { if (tNodeList.Where(x => x.Id == child.Id).Count() > 1) { continue; } ComputePaths(child, tNodeList); } } else { nodeRouteList.Add(tNodeList); } }