public async Task <IDirectory[]> GetDirectories() { return((await Task.WhenAll(ContentDirectories.Select(async a => await a.GetDirectories()))).SelectMany(a => a) .GroupBy(a => a.Name).Select(a => { var list = a.ToArray(); if (a.Count() == 1) { return list[0]; } else if (a.Count() == 0) { return null; } else { return new DirectoryCombined(list, a.Key); } }).Where(a => a != null).ToArray()); }
public async Task <IFile[]> GetFiles() { return((await Task.WhenAll(ContentDirectories.Select(async a => await a.GetFiles()))).SelectMany(a => a).ToArray()); }