Filtering.Net.EntityFrameworkCore
0.1.2
dotnet add package Filtering.Net.EntityFrameworkCore --version 0.1.2
NuGet\Install-Package Filtering.Net.EntityFrameworkCore -Version 0.1.2
<PackageReference Include="Filtering.Net.EntityFrameworkCore" Version="0.1.2" />
<PackageVersion Include="Filtering.Net.EntityFrameworkCore" Version="0.1.2" />
<PackageReference Include="Filtering.Net.EntityFrameworkCore" />
paket add Filtering.Net.EntityFrameworkCore --version 0.1.2
#r "nuget: Filtering.Net.EntityFrameworkCore, 0.1.2"
#:package Filtering.Net.EntityFrameworkCore@0.1.2
#addin nuget:?package=Filtering.Net.EntityFrameworkCore&version=0.1.2
#tool nuget:?package=Filtering.Net.EntityFrameworkCore&version=0.1.2
Filtering.Net.EntityFrameworkCore
EF Core async helpers for Filtering.Net. Adds IQueryable<T>.ApplyPagedAsync(...) and PageResult<T>.
Targets net8.0, net9.0, and net10.0.
What it solves
Filtering.Net itself stays netstandard2.0 and avoids any EF Core dependency, so it can load inside the analyzer process and on every consumer TFM. EF-specific async sequencing (CountAsync + ToListAsync + PageResult<T> packaging) lives in this package — install it when your call site is an EF Core controller / handler that wants a one-call paged response.
Install
dotnet add package Filtering.Net
dotnet add package Filtering.Net.Generator
dotnet add package Filtering.Net.EntityFrameworkCore
The first two are required (runtime + generator). This package adds the EF-specific helpers on top.
Quickstart
Given a [GenerateFilter<User>] partial (see Filtering.Net.Generator) and an EF DbContext:
[ApiController]
[Route("users")]
public sealed class UsersController : ControllerBase
{
[HttpPost("search")]
public async Task<ActionResult<PageResult<User>>> Search(
[FromBody] FilterRequest request,
[FromServices] IFilterDefinition<User> userFilter,
[FromServices] AppDbContext dbContext,
CancellationToken cancellationToken)
{
try
{
PageResult<User> page = await dbContext.Users
.ApplyPagedAsync(userFilter, request, cancellationToken);
return Ok(page);
}
catch (FilterValidationException invalid)
{
return BadRequest(invalid.Result);
}
}
}
ApplyPagedAsync validates the request, applies filter + sort, runs CountAsync + ToListAsync against the EF provider, and packages the results into a PageResult<T>.
Key types
PageResult<T>—Items,TotalCount,Page,PageSize. Computed members:TotalPages,HasPrevious,HasNext. Don't store the computed members; they round-trip through the constructor.FilteringEntityFrameworkExtensions.ApplyPagedAsync— the one extension method this package adds:IQueryable<T>.ApplyPagedAsync(IFilterDefinition<T>, FilterRequest, CancellationToken).
EF version pinning
| Target framework | EF Core version |
|---|---|
net8.0 |
8.0.13 (LTS floor — patches GHSA-qj66-m88j-hmgj) |
net9.0 |
9.0.5 (patches GHSA-qj66-m88j-hmgj) |
net10.0 |
10.0.0 (LTS floor) |
Bumping these is intentional — the integration tests run against both, so a floor bump is a contract-affecting change.
See also
- Documentation site — full guides, API reference, diagnostics catalogue.
- Repo on GitHub — source, issue tracker, contribution notes.
Filtering.Net— runtime request types.Filtering.Net.Generator— source generator + 24-rule analyzer.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Filtering.Net (>= 0.1.2)
- Microsoft.EntityFrameworkCore (>= 10.0.0)
-
net8.0
- Filtering.Net (>= 0.1.2)
- Microsoft.EntityFrameworkCore (>= 8.0.13)
-
net9.0
- Filtering.Net (>= 0.1.2)
- Microsoft.EntityFrameworkCore (>= 9.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.