Nedo.AspNet.QueryEngine.ApiContracts
2.1.0
dotnet add package Nedo.AspNet.QueryEngine.ApiContracts --version 2.1.0
NuGet\Install-Package Nedo.AspNet.QueryEngine.ApiContracts -Version 2.1.0
<PackageReference Include="Nedo.AspNet.QueryEngine.ApiContracts" Version="2.1.0" />
<PackageVersion Include="Nedo.AspNet.QueryEngine.ApiContracts" Version="2.1.0" />
<PackageReference Include="Nedo.AspNet.QueryEngine.ApiContracts" />
paket add Nedo.AspNet.QueryEngine.ApiContracts --version 2.1.0
#r "nuget: Nedo.AspNet.QueryEngine.ApiContracts, 2.1.0"
#:package Nedo.AspNet.QueryEngine.ApiContracts@2.1.0
#addin nuget:?package=Nedo.AspNet.QueryEngine.ApiContracts&version=2.1.0
#tool nuget:?package=Nedo.AspNet.QueryEngine.ApiContracts&version=2.1.0
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 | ✅ | ✅ |
| Timezone Aware 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
Full docs: docs/README.md
Getting Started
| Guide | Description |
|---|---|
| Installation | NuGet, project setup |
| Quick Start — EF Core | First query in 5 minutes |
| Quick Start — SqlKata | First query in 5 minutes |
Provider Guides
★ = Provider-exclusive feature
Reference
| Guide | Description |
|---|---|
| JSON Reference | Provider-agnostic JSON request format (8 docs) |
| Architecture | Pipeline, strategy pattern, result transformation |
| Schema & Annotations | Validation, entity attributes, discovery |
| Mutation Pipeline | 5-stage pipeline, hooks, context |
| Security Overview | RLS, field security, PolicyContext |
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. |
-
net9.0
- Nedo.AspNet.ApiContracts (>= 3.0.0)
- Nedo.AspNet.QueryEngine (>= 2.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Nedo.AspNet.QueryEngine.ApiContracts:
| Package | Downloads |
|---|---|
|
Nedo.AspNet.Authorization
Authorization engine for ASP.NET Core: roles as a code-ring tree, organization scoping, per-page and per-field grants, row-level data filters with an expression language, delegations, and an admin API over the whole model. Table and column names are the host's to choose; migrations belong to the application, not to this package. |
GitHub repositories
This package is not used by any popular GitHub repositories.