private async Task <QueryHierarchyItem> InternalGetStoredQueriesAsync(string projectName, QueryHierarchyItem parent, bool?includeDeleted, CancellationToken cancellationToken) { if (parent.Children == null) { using var mc = log?.Enter(LogLevel.RawApis, new object[] { projectName, parent.Path, QueryExpand.All, 2, includeDeleted, null, cancellationToken }, "GetQueryAsync"); parent = await WorkItemClient.GetQueryAsync(projectName, parent.Path, QueryExpand.All, depth : 2, includeDeleted, userState : null, cancellationToken); } for (int i = 0; i < parent.Children.Count; i++) { QueryHierarchyItem item = parent.Children[i]; if (item.HasChildren == true) { parent.Children[i] = await InternalGetStoredQueriesAsync(projectName, item, includeDeleted, cancellationToken); } } return(parent); }