Skip to content

peterjohncasasola/FlexQuery.NET

Repository files navigation

FlexQuery.NET

Dynamic filtering, sorting, paging, and projection for IQueryable in .NET.

NuGet Version NuGet Downloads .NET Documentation License

FlexQuery.NET is a dynamic query engine for .NET REST APIs. It transforms complex query parameters into secure, server-side expression trees — filtering, sorting, paging, and projecting data with a single line of code.

var result = await _context.Users.FlexQueryAsync(parameters, opts =>
{
    opts.AllowedFields = ["Id", "Name", "Email", "Status"];
});

Works with Entity Framework Core, Dapper, and other FlexQuery.NET providers.

Why FlexQuery.NET?

  • No OData Dependency — Get powerful querying without OData's complexity and tight coupling
  • 100% Server-Side — All operations translate to SQL via expression trees — zero client evaluation
  • Security First — Declare allowed/blocked fields per-endpoint with strict validation
  • Multi-Format — Auto-detects DSL, JSON, JQL, and OData query syntax on the same endpoint
  • Multiple Data Providers — Works with EF Core, Dapper, or any IQueryable source

Package Ecosystem

graph TD
    Core["FlexQuery.NET"]
    Core --> EF["FlexQuery.NET.EntityFrameworkCore"]
    Core --> Dapper["FlexQuery.NET.Dapper"]
    Core --> AspNet["FlexQuery.NET.AspNetCore"]
    Core --> Diag["FlexQuery.NET.Diagnostics"]
    EF --> AgGrid["FlexQuery.NET.Adapters.AgGrid"]
    EF --> Kendo["FlexQuery.NET.Adapters.Kendo"]
    Dapper --> AgGrid
    Dapper --> Kendo
    AspNet --> AgGrid
    AspNet --> Kendo
    Core --> Jql["FlexQuery.NET.Parsers.Jql"]
    Core --> OData["FlexQuery.NET.Parsers.MiniOData"]
Loading
Package Purpose
FlexQuery.NET Core query engine — parsing, filtering, sorting, paging, projection, validation
FlexQuery.NET.EntityFrameworkCore Async execution and filtered includes for EF Core
FlexQuery.NET.Dapper SQL generation and execution for Dapper
FlexQuery.NET.AspNetCore ASP.NET Core integration with [FieldAccess] security attributes
FlexQuery.NET.Diagnostics Execution diagnostics, timing, and observability
FlexQuery.NET.Adapters.AgGrid AG Grid Server-Side Row Model (SSRM) request/response adapter
FlexQuery.NET.Adapters.Kendo Kendo UI DataSource request adapter
FlexQuery.NET.Parsers.Jql JQL (Jira Query Language) syntax parser
FlexQuery.NET.Parsers.MiniOData Lightweight OData-compatible syntax parser

Supported Query Formats

GET /api/users?filter=age:gte:18&sort=name:asc&page=1&pageSize=20     # DSL (default)
GET /api/users?filter=Age >= 18 AND Status = 'Active'                  # JQL
GET /api/users?$filter=Age ge 18 and Status eq 'Active'               # OData

Getting Started

dotnet add package FlexQuery.NET.EntityFrameworkCore

Full guide: flexquery.vercel.app/guide/getting-started

Documentation

License

MIT License. See LICENSE.

About

Flexible querying for .NET IQueryable — filtering, sorting, paging, projection, validation, and security

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors