So, I have this procedure:
public static IEnumerable<string> GetFiles( string path, string[] searchPatterns, SearchOption searchOption = SearchOption.TopDirectoryOnly) {
return searchPatterns.AsParallel()
.SelectMany(searchPattern =>
Directory.EnumerateFiles(path, searchPattern, searchOption))
.OrderBy<string, string>( (f) => f)
.Distinct<string>();
}
and it works, but ordering files by its name, and I need to order the files returned by its creation date. How can I sort if the item is a string similar to a procedure. I want to use files named Enumerate, expected to be more than 1k.
Thank.
source
share