public IOrderedEnumerable <IContentSource> Evaluate(ResourceType resourceType) { var physicalPath = VirtualPathResolver.ResolveVirtualPathToDirectory(FolderVirtualPath); if (physicalPath == null) { return(Enumerable.Empty <IContentSource>().OrderBy(x => x)); } return(Directory.GetFiles(physicalPath.FullName, SearchPattern ?? "*", IsRecursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly) .Select(f => new FileInfo(f)) .Select(file => PhysicalFileRegister.For(file, resourceType, Mode)) .OfType <IContentSource>() .OrderBy(x => new FileInfo(((PhysicalFileSource)x).PhysicalPath).Name)); }
private static PhysicalFileSource GetPhysicalFileFor(string requestedFilename) { requestedFilename = MakeVirtualPathFromRequestUrl(requestedFilename); return(PhysicalFileRegister.For(requestedFilename)); }