ItemSpec spec = new ItemSpec(string.Format(@"$\{0}\Folder\{1}", project, branch), RecursionType.Full);
Now what I want to do is stop the query at “branch”. Is this possible? How do I prevent it from returning all subfolders without string manipulation and if checks?
You want to query for all items in
branch? Just useRecursionType.None. When you pass the followingItemSpectoGetItems:You will be returned only the items directly in the
branchfolder, excluding children.