protected List <Metadata> GetDropboxItems(object parentId, bool?folder = null) { var dropboxFolderPath = MakeDropboxPath(parentId); var items = ProviderInfo.GetDropboxItems(dropboxFolderPath); if (folder.HasValue) { if (folder.Value) { return(items.Where(i => i.AsFolder != null).ToList()); } return(items.Where(i => i.AsFile != null).ToList()); } return(items); }