DynamicQuery.NetFramework
2.0.1
dotnet add package DynamicQuery.NetFramework --version 2.0.1
NuGet\Install-Package DynamicQuery.NetFramework -Version 2.0.1
<PackageReference Include="DynamicQuery.NetFramework" Version="2.0.1" />
<PackageVersion Include="DynamicQuery.NetFramework" Version="2.0.1" />
<PackageReference Include="DynamicQuery.NetFramework" />
paket add DynamicQuery.NetFramework --version 2.0.1
#r "nuget: DynamicQuery.NetFramework, 2.0.1"
#:package DynamicQuery.NetFramework@2.0.1
#addin nuget:?package=DynamicQuery.NetFramework&version=2.0.1
#tool nuget:?package=DynamicQuery.NetFramework&version=2.0.1
DynamicQuery.AspNetCore
OData-inspired URL query binding for ASP.NET Core. Parses query string parameters into LINQ expression trees for filtering, sorting, paging, and projection.
This library is not GraphQL. It binds REST query parameters such as ?query=name=Bruno&order=name&page=0&pagesize=10 to strongly typed expressions you can use with IQueryable, EF Core, or in-memory collections.
Renamed from Graphql.DynamicFilter
This project was originally published as Graphql.DynamicFilter on NuGet (~41k downloads). The old name was misleading — the library provides OData-style URL query binding, not GraphQL.
Starting with 2.0, development continues under new package IDs:
| Legacy package (1.x) | New package (2.x) |
|---|---|
| Graphql.DynamicFilter | DynamicQuery.AspNetCore |
| Graphql.DynamicFilter.NetFramework | DynamicQuery.NetFramework |
The query string format is unchanged. Only the package name, namespaces, and type names changed (DynamicFilter<T> → DynamicQuery<T>).
Packages
| Package | Description |
|---|---|
| DynamicQuery.AspNetCore | ASP.NET Core (net8.0, net9.0, net10.0) — controllers and minimal APIs |
| DynamicQuery.NetFramework | ASP.NET MVC 5 on .NET Framework 4.7.2 |
Installation
dotnet add package DynamicQuery.AspNetCore
Quick start — Controllers
using DynamicQuery.AspNetCore;
[HttpGet]
public Task<List<User>> Get(DynamicQuery<User> query)
{
var result = _users.Apply(query).ToList();
return Task.FromResult(result);
}
Example request:
GET /api/users?query=name=Bruno
Generated expression:
x => x.Name == "Bruno"
Quick start — Minimal APIs
app.MapGet("/users", (DynamicQuery<User> query) =>
{
return users.Apply(query).ToList();
});
DynamicQuery<T> implements the minimal API BindAsync convention automatically.
Query syntax
Multiple filters are combined with AND (comma-separated). Use | within a value for OR.
| Operator | Example | Meaning |
|---|---|---|
| Equals | name=Bruno |
exact match |
| Contains (case-insensitive) | name%b |
substring |
| Contains (case-sensitive) | name%%B |
substring |
| Greater than | age>15 |
|
| Greater or equal | age>=15 |
|
| Less than | age<15 |
|
| Less or equal | age<=15 |
|
| Not equals | age!=15 |
|
| Nested property | address.number=23 |
dot notation |
Use query= or filter= for the filter parameter (both are supported).
Ordering
GET /api/users?query=name%b&order=name=Asc
GET /api/users?query=name%b&order=name=Desc
If direction is omitted, default is Desc (same as v1.x ASP.NET Core behavior).
Paging
GET /api/users?query=name%b&order=name&page=0&pagesize=10
Projection (select)
GET /api/users?select=name,age
Populates query.Select (Expression<Func<T,T>>) and query.SelectText.
Apply helper
using DynamicQuery.AspNetCore;
// In-memory collections (uses compiled expressions)
var items = users.Apply(query);
// IQueryable / EF Core (uses expression trees)
var items = dbContext.Users.Apply(query);
MVC registration (optional)
Model binding works via the [ModelBinder] attribute on DynamicQuery<T>. To register the binder provider explicitly:
builder.Services.AddControllers()
.AddDynamicQuery();
Migration from Graphql.DynamicFilter 1.x
If you installed the old package:
# Remove the legacy package
dotnet remove package Graphql.DynamicFilter
# Install the renamed package
dotnet add package DynamicQuery.AspNetCore
Update your code:
using Graphql.DynamicFiltering→using DynamicQuery.AspNetCoreDynamicFilter<T>→DynamicQuery<T>
Full details: CHANGELOG.md
Development
dotnet build DynamicQuery.sln
dotnet test DynamicQuery.sln
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- DynamicQuery.Parser (>= 2.0.1)
- Microsoft.AspNet.Mvc (>= 5.2.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.