I have the following code to get the sub-folders and files inside a folder, but this code will not retrieve any sub-folder and files found at deeper level. so can anyone advice how i can get all the files and folders within a folder?
Folder folder = context.Web.GetFolderByServerRelativeUrl(context.Web.ServerRelativeUrl + "/library3/" + currentFilingSystemItem["DealName"].ToString());
FileCollection files = folder.Files;
FolderCollection folders = folder.Folders;
context.Load(files, fs => fs.Include(f => f.ListItemAllFields));
context.Load(folders, fs => fs.Include(f => f.ListItemAllFields));
foreach (File f in files)
{
}
foreach (Folder fo in folders)
{
}