public IEnumerable <Tuple <string[], DemoDetail[]> > GetDemosGroupedByFolder() { return(Demos .GroupBy( x => new DirectoryPath(baseDirectory, Path.GetDirectoryName(x.Path)), y => y) .OrderBy(x => x.Key.SplitPath.Length) .Select(x => Tuple.Create(x.Key.SplitPath, x.ToArray()))); }