FlexQuery.NETTurn your API into a secure, composable query engine
Flexible querying for .NET IQueryable — filtering, sorting, paging, projection, validation, and security
Flexible querying for .NET IQueryable — filtering, sorting, paging, projection, validation, and security

Building APIs with dynamic filtering often leads to repetitive, hardcoded LINQ queries that are brittle and difficult to scale.
FlexQuery.NET transforms this experience by providing a unified query engine that parses client-defined criteria into optimized, secure database queries.
if blocks for every filter combination.Send a single HTTP request and get filtered, projected, and paginated results:
Request
GET /api/customers?query=name contains "Connelly"
&select=id,name,email,orders.id,orders.status
&include=orders(status = "cancelled")
&pageSize=10Controller
[HttpGet]
public async Task<IActionResult> Get([FromQuery] QueryRequest request)
{
// 1. Parse query into internal options
var options = QueryOptionsParser.Parse(request);
// 2. Execute full pipeline: Filter + Sort + Paging + Projection
var results = await _context.Users
.ToProjectedQueryResultAsync(options);
return Ok(results);
}FlexQuery.NET is built as a layered system, allowing you to choose the perfect balance between abstraction and flexibility.
ApplyFilter, ApplySort, ApplyPaging.ApplyQueryOptions or ApplyValidatedQueryOptions.ToProjectedQueryResultAsync.select and powerful field aliases.