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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Jeninnet.FileQuery.FileProviders" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jeninnet.FileQuery.FileProviders" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Jeninnet.FileQuery.FileProviders" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Jeninnet.FileQuery.FileProviders --version 2.0.0
                    
#r "nuget: Jeninnet.FileQuery.FileProviders, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Jeninnet.FileQuery.FileProviders@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Jeninnet.FileQuery.FileProviders&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Jeninnet.FileQuery.FileProviders&version=2.0.0
                    
Install as a Cake Tool

Jeninnet.FileQuery.FileProviders

NuGet Version NuGet Downloads

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; RelativePath is relative to the scoped root.
  • Length and LastModified come from IFileInfo. Providers expose one timestamp, so it maps to both creation and last-write time.
  • Attributes are Directory or Normal; provider entries do not expose platform attribute flags.
  • Directory results, .gitignore ingestion, diff-aware restrictions, and all pattern dialects are supported.
  • FileQueryBatch is physical-only; run one query per provider root instead.
  • Execute through the builder. Engines created by FileQueryRuntime or AddFileQuery() are bound to the physical file system.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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