pnpcore
pnpcore copied to clipboard
Allow for requesting data in IFolder.EnsureFolder
Category
- [x] Feature request
Describe the feature
IFolder.EnsureFolder (and EnsureFolderAsync) currently does not support taking an expressions parameter like methods like IWeb.GetFolderByServerRelativeUrl do. This means if the folder exists, data for the returned IFolder cannot be requested, requiring an additional API call.
Describe the solution you'd like
Add an overload for (or update the existing functions) IFolder.EnsureFolder (and EnsureFolderAsync) that also takes params Expression<Func<IFolder, object>>[] expressions. This should then be passed to the GetFolderByServerRelativeUrl call in the last iteration of the foreach, so that the final folder returned has the requested data.