public async Task OnGetAsync() { List <ServiceFresh.File> result = await client.GetFilesAsync(); foreach (var file in result) { Models.FileDTO dto = new Models.FileDTO(file); Files.Add(dto); } if (!string.IsNullOrEmpty(SearchString)) { Files.Clear(); List <ServiceFresh.Data> datas = await client.GetDatasAsync(); List <ServiceFresh.FileData> filedatas = await client.GetFileDatasAsync(); ServiceFresh.Data data = datas.Find(item => item.Label.Equals(SearchString)); if (data != null) { Files = new List <Models.FileDTO>(); foreach (ServiceFresh.File file in result) { ServiceFresh.FileData fd = filedatas.Find(item => item.DataId == data.DataId && item.FileId == file.FileId); if (fd != null) { Models.FileDTO dto = new Models.FileDTO(file); Files.Add(dto); } } } } }
public async void Test() { ServiceFresh.InterfaceWCFClient client = new ServiceFresh.InterfaceWCFClient(); List <ServiceFresh.File> files = await client.GetFilesAsync(); foreach (ServiceFresh.File f in files) { Console.WriteLine(f.Name); } }