FlexQuery.NET.Parsers.Jql 3.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package FlexQuery.NET.Parsers.Jql --version 3.0.2
                    
NuGet\Install-Package FlexQuery.NET.Parsers.Jql -Version 3.0.2
                    
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="FlexQuery.NET.Parsers.Jql" Version="3.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FlexQuery.NET.Parsers.Jql" Version="3.0.2" />
                    
Directory.Packages.props
<PackageReference Include="FlexQuery.NET.Parsers.Jql" />
                    
Project file
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 FlexQuery.NET.Parsers.Jql --version 3.0.2
                    
#r "nuget: FlexQuery.NET.Parsers.Jql, 3.0.2"
                    
#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 FlexQuery.NET.Parsers.Jql@3.0.2
                    
#: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=FlexQuery.NET.Parsers.Jql&version=3.0.2
                    
Install as a Cake Addin
#tool nuget:?package=FlexQuery.NET.Parsers.Jql&version=3.0.2
                    
Install as a Cake Tool

FlexQuery.NET

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

NuGet Version NuGet Downloads Dotnet Support Documentation License


FlexQuery.NET is a lightweight and powerful dynamic query engine for .NET. It allows you to transform complex API query parameters into optimized, EF Core-translatable expression trees with a single line of code.

⚡ Key Features

  • Dynamic Querying: Powerful DSL, JQL, and JSON-based filtering.
  • IQueryable-Native: 100% server-side translation—no client-side evaluation.
  • Advanced Projection: Automatic SQL SELECT optimization including nested includes.
  • Governance & Security: Built-in field-level validation and operator restrictions.
  • High Performance: Thread-safe expression caching for ultra-low latency.

🚀 Quick Start

1. Installation

dotnet add package FlexQuery.NET
dotnet add package FlexQuery.NET.EntityFrameworkCore
dotnet add package FlexQuery.NET.Dapper
dotnet add package FlexQuery.NET.AspNetCore
dotnet add package FlexQuery.NET.Adapters.AgGrid

2. Entity Framework Core (Default)

Securely execute a dynamic query directly from your controller against an EF Core DbContext. The provider handles translation, pagination, and async execution automatically.

[HttpGet("users")]
public async Task<IActionResult> GetUsers([FromQuery] FlexQueryParameters parameters)
{
    var result = await _context.Users.FlexQueryAsync(parameters, options => 
    {
        options.AllowedFields = new HashSet<string> { "Id", "Name", "Email", "Status" };
        options.StrictFieldValidation = true;
        options.UseNoTracking = true; // Optimization for read-only queries
    });

    return Ok(result);
}

3. Dapper & Raw SQL Integration

For high-performance API endpoints or non-EF Core projects, use the Dapper provider to generate secure, dialect-aware, fully parameterized SQL queries.

using FlexQuery.NET.Dapper;
using FlexQuery.NET.Dapper.Dialects;

[HttpGet("users")]
public async Task<IActionResult> GetUsersDapper([FromQuery] FlexQueryParameters parameters)
{
    using var connection = new SqlConnection("Server=...;");    
    // Generates parameterized SQL, handles dialects (SQL Server, Postgres, MySQL, etc.)
    var result = await connection.FlexQueryAsync<User>(parameters, options => 
    {
        options.Dialect = new SqlServerDialect(); 
        options.AllowedFields = new HashSet<string> { "Id", "Name", "Email" };
    });

    return Ok(result);
}

4. AG Grid Adapter

FlexQuery.NET.Adapters.AgGrid parses AG Grid's Enterprise Server-Side Row Model JSON payloads natively, translating pagination, filtering, sorting, row grouping, and aggregations into FlexQuery operations.

[HttpPost("grid")]
public async Task<IActionResult> GetGridData([FromBody] AgGridRequest request)
{
    // 1. Parse AG Grid request into canonical QueryOptions
    var options = request.ToQueryOptions();

    // 2. Execute via EF Core or Dapper
    var result = await _context.Users.FlexQueryAsync<User>(options, opts =>
    {
        opts.AllowedFields = new HashSet<string> { "Id", "Name", "Status", "CreatedAt" };
    });

    // 3. Return format expected by AG Grid
    return Ok(new { rowData = result.Data, rowCount = result.TotalCount });
}

5. MiniOData Parser

Migrating from OData? FlexQuery.NET.Parsers.MiniOData acts as a drop-in bridge, automatically detecting and parsing OData syntax ($filter, $orderby, $top, $skip) on the same endpoint that handles JSON and JQL queries.

// Program.cs
builder.Services.AddFlexQueryMiniOData();

// Controller
[HttpGet("products")]
public async Task<IActionResult> GetProducts([FromQuery] FlexQueryParameters parameters)
{
    // Auto-detects OData parameters like:
    // ?$filter=Price gt 50 and Category eq 'Electronics'&$orderby=Name desc
    var result = await _context.Products.FlexQueryAsync(parameters);
    return Ok(result);
}

6. Example Query Requests

FlexQuery unifies multiple formats under the same API without configuration:

# Native DSL
GET /api/users?filter=age:gt:18&sort=createdAt:desc&page=1&pageSize=20

# JQL Syntax
GET /api/users?filter=Age > 18 AND Status = 'Active'

# OData Syntax (requires MiniOData package)
GET /api/users?$filter=Age gt 18 and Status eq 'Active'

📚 Documentation

For detailed guides, API references, and advanced scenarios, visit our documentation site:

👉 https://flexquery.vercel.app


📄 License

FlexQuery.NET is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.0 0 6/26/2026
3.0.6 46 6/24/2026
3.0.5 47 6/24/2026
3.0.4 45 6/23/2026
3.0.3 49 6/23/2026
3.0.2 94 6/22/2026
3.0.1 98 6/22/2026

# FlexQuery.NET v3.0.2 Release Notes

**Release date:** 2026-06-22

## Overview

v3.0.2 streamlines the AG Grid integration with a simplified, extension-method-based API and improves documentation for the adapter package. This release contains no breaking changes.

## What's New

### Simplified AG Grid API

The AG Grid adapter now provides extension methods on `AgGridRequest` and `QueryOptions`, removing the need to reference `AgGridQueryOptionsParser` directly.

**Before (v3.0.1):**

```csharp
using FlexQuery.NET.Adapters.AgGrid.Parsers;

[HttpPost("grid")]
public async Task<IActionResult> GetGridData([FromBody] JsonElement payload)
{
   var options = AgGridQueryOptionsParser.Parse(payload);
   var result = await _context.Users.FlexQueryAsync<User>(options);
   return Ok(result);
}
```

**After (v3.0.2):**

```csharp
[HttpPost("grid")]
public async Task<IActionResult> GetGridData([FromBody] AgGridRequest request)
{
   var options = request.ToQueryOptions();
   var result = await _context.Users.FlexQueryAsync<User>(options);
   return Ok(result);
}
```

### New Extension Methods

| Method | Description |
|---|---|
| `AgGridRequest.ToQueryOptions()` | Converts an AG Grid request into `QueryOptions` |
| `QueryOptions.ApplyAgGridRequest(AgGridRequest)` | Merges AG Grid filters, sorts, paging, grouping, and aggregates into an existing `QueryOptions` instance |
| `string.FromAgGridJson()` | Parses a raw JSON string into `QueryOptions` |

---

## Other Changes

- **Documentation:** README and AG Grid adapter guide updated to reflect the new simplified API.

---

## Upgrading

Update the `FlexQuery.NET.Adapters.AgGrid` package to v3.0.2:

```bash
dotnet add package FlexQuery.NET.Adapters.AgGrid --version 3.0.2
```

No code migration is required — all existing `AgGridQueryOptionsParser.Parse()` calls continue to work. The new extension methods are optional.