What's the most performant way to get a sub-folder ID from its name?
We're using the .Net SDK and currently have code that calls FoldersManager.GetFolderItemsAsync and iterates through the results to find the matching item name. It works, but I think it must be inefficient in having to return all sub-folders.
I'd expect to be able to get the result directly, using SearchManager.SearchAsync, but so far I'm not being very successful. Here's what I've tried so far - but it returns no result:
var items = await actor.SearchManager.SearchAsync(
limit: 2,
ancestorFolderIds: new List() { parentFolderId },
type: "folder",
scope: "user_content",
keyword: folderName );
What am I doing wrong?
Is this the optimal thing to do, or is there perhaps an even better way?
Please sign in to leave a comment.
Comments
0 comments