Jeninnet.FileQuery.FileProviders
2.0.0
Requires NuGet 6.0.0 or higher.
dotnet add package Jeninnet.FileQuery.FileProviders --version 2.0.0
NuGet\Install-Package Jeninnet.FileQuery.FileProviders -Version 2.0.0
<PackageReference Include="Jeninnet.FileQuery.FileProviders" Version="2.0.0" />
<PackageVersion Include="Jeninnet.FileQuery.FileProviders" Version="2.0.0" />
<PackageReference Include="Jeninnet.FileQuery.FileProviders" />
paket add Jeninnet.FileQuery.FileProviders --version 2.0.0
#r "nuget: Jeninnet.FileQuery.FileProviders, 2.0.0"
#:package Jeninnet.FileQuery.FileProviders@2.0.0
#addin nuget:?package=Jeninnet.FileQuery.FileProviders&version=2.0.0
#tool nuget:?package=Jeninnet.FileQuery.FileProviders&version=2.0.0
Jeninnet.FileQuery.FileProviders
Query Microsoft.Extensions.FileProviders.IFileProvider sources with
Jeninnet.FileQuery. ASP.NET Core static files, Razor assets,
embedded resources, and custom in-memory providers share the same patterns, metadata filters,
directory results, GitIgnore ingestion, and error recovery as disk queries.
No files are copied or materialized to disk.
Install
dotnet add package Jeninnet.FileQuery.FileProviders
The package references Microsoft.Extensions.FileProviders.Abstractions; the core library stays
dependency-free. Install the adapter and core from the same release: the adapter uses friend access
to the engine's internal IFileSystem, and mixing it with an older core package fails at runtime.
Quick start
using Jeninnet.FileQuery.Enums;
using Jeninnet.FileQuery.FileProviders;
using Microsoft.Extensions.FileProviders;
using var provider = new PhysicalFileProvider(@"C:\MyProject");
var files = FileProviderQuery.From(provider)
.UsingGlob()
.Where(PatternKind.Glob, ["**/*.cs"])
.Execute();
foreach (var path in files)
{
Console.WriteLine(path);
}
From(provider, root) returns a normal FileQueryBuilder; root defaults to / and scopes the
query below the provider root:
var css = FileProviderQuery.From(provider, "/wwwroot/css")
.UsingGlob()
.Where(PatternKind.Glob, ["**/*.css"])
.ExecuteEntries();
ASP.NET Core registration
builder.Services.AddSingleton<IFileProvider>(_ =>
new PhysicalFileProvider(builder.Environment.WebRootPath!));
builder.Services.AddScoped<StaticAssetScanner>();
public sealed class StaticAssetScanner(IFileProvider provider)
{
public IReadOnlyList<FileQueryEntry> FindStylesheets() =>
FileProviderQuery.From(provider, "/css")
.UsingGlob()
.Where(PatternKind.Glob, ["**/*.css"])
.MinSize(1)
.ExecuteEntries()
.ToList();
}
API
| Surface | Behavior |
|---|---|
FileProviderQuery.From(provider, root = "/") |
Creates a provider-backed FileQueryBuilder |
Execute / ExecuteAsync |
Path results rooted in virtual path space |
ExecuteEntries / ExecuteEntriesAsync |
FileQueryEntry metadata results |
IncludeDirectories |
Yield matching directories |
MinSize / MaxSize / ModifiedAfter / ModifiedBefore |
Metadata filters |
UseGitIgnoreFiles |
Load .gitignore files through the provider |
RestrictToPaths |
Diff-aware restrictions |
WithErrorRecovery |
Skip/Retry/Abort for provider failures |
Semantics
- Paths are virtual and use forward slashes.
Execute()returns rooted paths;RelativePathis relative to the scoped root. LengthandLastModifiedcome fromIFileInfo. Providers expose one timestamp, so it maps to both creation and last-write time.- Attributes are
DirectoryorNormal; provider entries do not expose platform attribute flags. - Directory results,
.gitignoreingestion, diff-aware restrictions, and all pattern dialects are supported. FileQueryBatchis physical-only; run one query per provider root instead.- Execute through the builder. Engines created by
FileQueryRuntimeorAddFileQuery()are bound to the physical file system.
Related
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Jeninnet.FileQuery (>= 2.0.0)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 449 | 11/2/2026 |
See CHANGELOG.md and Migration.md at https://github.com/TarekNajem04/Jeninnet.FileQuery