public virtual async Task <List <T> > GetListAsync() { var fileNames = await _fileManager.GetFileNamesAsync(); var tasks = new List <Task <string> >(); foreach (var fileName in fileNames) { tasks.Add(_fileManager.GetTextFileAsync(fileName)); } IEnumerable <string> jsonFiles = Task.WhenAll(tasks).Result; var list = new List <T>(); foreach (var json in jsonFiles) { var item = JsonConvert.DeserializeObject <T>(json); list.Add(item); } return(list); }
public virtual async Task <List <string> > GetFileNamesAsync() { return(await _fileManager.GetFileNamesAsync()); }