Nedo.AspNet.QueryEngine
1.0.6
dotnet add package Nedo.AspNet.QueryEngine --version 1.0.6
NuGet\Install-Package Nedo.AspNet.QueryEngine -Version 1.0.6
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="Nedo.AspNet.QueryEngine" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nedo.AspNet.QueryEngine" Version="1.0.6" />
<PackageReference Include="Nedo.AspNet.QueryEngine" />
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 Nedo.AspNet.QueryEngine --version 1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Nedo.AspNet.QueryEngine, 1.0.6"
#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 Nedo.AspNet.QueryEngine@1.0.6
#: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=Nedo.AspNet.QueryEngine&version=1.0.6
#tool nuget:?package=Nedo.AspNet.QueryEngine&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Nedo.AspNet.QueryEngine
A unified, JSON-driven query engine for .NET that converts a single QueryRequest model into executable queries for SqlKata (raw SQL) and EF Core (IQueryable<T>).
Features
| Feature | SqlKata | EF Core |
|---|---|---|
| Filters (40+ operators) | ✅ | ✅ |
| Filter Groups (AND/OR nesting) | ✅ | ✅ |
| Search (Contains, StartsWith, EndsWith, Exact) | ✅ | ✅ |
| Sort (multi-field) | ✅ | ✅ |
| Pagination (offset + cursor) | ✅ | ✅ |
| Select / Functions / CASE WHEN | ✅ | ✅ |
| Joins (manual) | ✅ | ✅ |
| Auto-Join (schema relations) | ✅ | — |
Response Shaping (nestRelations) |
✅ | ✅ |
| GroupBy / Aggregates / HAVING | ✅ | ✅ |
| Row-Level Security (RLS) | ✅ | ✅ |
| Field-Level Security | ✅ | ✅ |
| Schema Validation | ✅ | ✅ |
| Schema Discovery | ✅ | ✅ |
| Entity Annotations | ✅ | ✅ |
| Batch Queries | ✅ | ✅ |
| Query Profiling (Debug) | ✅ | ✅ |
| Fluent Builder API | ✅ | ✅ |
| Query Templates | ✅ | ✅ |
| ExecutePaged / QueryResult | ✅ | ✅ |
| QueryEndpointService | ✅ | ✅ |
| DI Registration | ✅ | ✅ |
| Computed / Virtual Fields | — | ✅ |
| Include (Nested Select) | — | ✅ |
| Streaming (IAsyncEnumerable) | — | ✅ |
Quick Start
// Parse JSON from frontend
var request = QueryRequestParser.Parse(json);
// SqlKata
var result = new Query("products").ExecutePaged(db, request);
// EF Core
var result = await dbContext.Products.ExecutePagedAsync(request);
JSON:
{
"filters": [
{ "field": "is_active", "operator": "Eq", "value": true },
{ "field": "price", "operator": "Gte", "value": 100 }
],
"sort": [{ "field": "price", "direction": "Desc" }],
"pagination": { "page": 1, "pageSize": 10 }
}
Response:
{
"rows": [{ "id": 1, "name": "MacBook Pro", "price": 2499.99 }, ...],
"total": 42,
"page": 1,
"pageSize": 10,
"totalPages": 5,
"hasNextPage": true
}
Documentation
| # | Guide | Topics |
|---|---|---|
| 1 | Getting Started | Installation, setup, first query (SqlKata + EF Core) |
| 2 | Filtering | 40+ operators, filter groups, search, temporal filters |
| 3 | Sorting & Pagination | Multi-field sort, offset, cursor, distinct, countOnly |
| 4 | Select & Functions | Columns, aliases, SQL functions, CASE WHEN, expressions |
| 5 | Joins | Manual joins, auto-join from schema, nestRelations |
| 6 | GroupBy & Aggregates | GroupBy, aggregates, HAVING clause |
| 7 | Schema & Annotations | Validation, annotations, discovery, multilanguage |
| 8 | Security | RLS, field-level security, soft delete, max page size |
| 9 | Advanced | Batch, profiling, templates, DI, streaming, includes |
ASP.NET Controller
[ApiController]
[Route("api/[controller]")]
public class ProductsController : ControllerBase
{
private readonly AppDbContext _db;
public ProductsController(AppDbContext db) => _db = db;
[HttpPost("query")]
public async Task<IActionResult> Query([FromBody] JsonElement json)
{
var request = QueryRequestParser.Parse(json.GetRawText());
var result = await _db.Products.ExecutePagedAsync(request);
return Ok(result);
}
}
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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.
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.13)
- SqlKata (>= 4.0.1)
- SqlKata.Execution (>= 4.0.1)
- System.Text.Json (>= 9.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.