public async Task <List <string> > GetFolderList() { ISynologyConnection syno = _scope.ServiceProvider.GetService <ISynologyConnection>(); var listVirtualFolder = await syno.FileStation().List().ListSharesAsync(new ListSharesParameters { }); var directory = new List <string>(); foreach (var data in listVirtualFolder.Data.Shares) { directory.Add(data.Name); } return(directory); }
public async Task <IEnumerable <string> > GetFolderList(string baseFolder) { ISynologyConnection syno = _scope.ServiceProvider.GetService <ISynologyConnection>(); var result = await syno.FileStation().List().ListFilesAsync(new ListParameters { FolderPath = baseFolder, Filetype = FileType.Directory }); var directory = new List <string>(); IFileListResult temp = result.Data; var json = JsonConvert.SerializeObject(temp); var test = JsonConvert.DeserializeObject <HackJsonIFileresult>(json).files.Select(x => x.name); return(test); }