![]() |
VOOZH | about |
dotnet add package Castle.DynamicLinqQueryBuilder.SystemTextJson --version 2.0.1
NuGet\Install-Package Castle.DynamicLinqQueryBuilder.SystemTextJson -Version 2.0.1
<PackageReference Include="Castle.DynamicLinqQueryBuilder.SystemTextJson" Version="2.0.1" />
<PackageVersion Include="Castle.DynamicLinqQueryBuilder.SystemTextJson" Version="2.0.1" />Directory.Packages.props
<PackageReference Include="Castle.DynamicLinqQueryBuilder.SystemTextJson" />Project file
paket add Castle.DynamicLinqQueryBuilder.SystemTextJson --version 2.0.1
#r "nuget: Castle.DynamicLinqQueryBuilder.SystemTextJson, 2.0.1"
#:package Castle.DynamicLinqQueryBuilder.SystemTextJson@2.0.1
#addin nuget:?package=Castle.DynamicLinqQueryBuilder.SystemTextJson&version=2.0.1Install as a Cake Addin
#tool nuget:?package=Castle.DynamicLinqQueryBuilder.SystemTextJson&version=2.0.1Install as a Cake Tool
👁 .NET
👁 Coverage Status
👁 Nuget
dynamic-linq-query-builder is a small library that allows any .NET collection to be filtered dynamically at runtime.
Version 2.0 is a performance-focused release that targets .NET 8+ exclusively. By dropping support for legacy frameworks (.NET 4.5, .NET Standard 2.0, .NET 6), we were able to leverage modern .NET APIs that simply weren't available before:
FrozenDictionary for faster operator dispatchSystem.DateOnly instead of a custom workaroundThe result is a faster, leaner library with new opt-in features for scenarios where performance really matters.
Still on an older framework? Version 1.3.4 remains available on NuGet and continues to support .NET 4.5, .NET Standard 2.0, .NET 6, and .NET 8.
IQueryable from any collection and filter combinationEF6, EF Core, and MongoDB Client >=2.19IFilterOperator interface and optionsStringComparison.OrdinalIgnoreCase mode for in-memory scenariosin operations| Scenario | v1.3.4 | v2.0 | Improvement |
|---|---|---|---|
Large in (500 values) |
3,525 μs | 421 μs | 88% faster |
| Repeated queries (cached) | 210 μs | 1.4 μs | 150x faster |
| String filter (ordinal mode) | 490 μs | 309 μs | 37% faster, 85% less memory |
All new features are opt-in — your existing code works without changes.
If you're running the same filter structure repeatedly (e.g., in a loop or API endpoint), enable caching to skip redundant expression building:
var options = new BuildExpressionOptions
{
EnableExpressionCaching = true, // Cache built expression trees
EnablePredicateCaching = true // Cache compiled delegates
};
// First call builds and caches; subsequent calls are ~150x faster
var results = myCollection.BuildQuery(filter, options).ToList();
For in-memory scenarios (not EF Core or other ORMs), enable ordinal string comparison to avoid ToLower() allocations:
var options = new BuildExpressionOptions
{
UseOrdinalStringComparison = true // Uses StringComparison.OrdinalIgnoreCase
};
var results = myCollection.BuildQuery(filter, options).ToList();
Note: Keep this
false(default) when using with EF Core, EF6, or other ORMs that translate expressions to SQL. TheToLower()approach is required for database compatibility.
Install via NuGet UI or Package Manager Console:
PM> Install-Package Castle.DynamicLinqQueryBuilder
For System.Text.Json support:
PM> Install-Package Castle.DynamicLinqQueryBuilder.SystemTextJson
Targets: .NET 8+
Migrating to v2.0 is straightforward:
net8.0 or laterIf you can't upgrade to .NET 8, stay on v1.3.4 — it's still fully functional and available on NuGet.
The easiest way to get started is to install the NuGet package and take a look at the MVC sample application included in the source code. It contains a working example of both dynamic-linq-query-builder and jQuery-QueryBuilder.
For more details, see the Wiki.
Contributions and pull requests are welcome with associated unit tests.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Castle.DynamicLinqQueryBuilder.SystemTextJson:
| Package | Downloads |
|---|---|
|
DataModeler
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.1 | 1,251 | 1/27/2026 |
| 2.0.0 | 357 | 1/21/2026 |
| 1.3.4 | 60,048 | 8/31/2024 |
| 1.3.3 | 5,115 | 8/30/2023 |
| 1.3.2 | 2,594 | 5/2/2023 |
| 1.3.1 | 337 | 4/29/2023 |
| 1.3.0 | 359 | 4/20/2023 |
| 1.2.9 | 1,957 | 10/8/2022 |
| 1.2.8 | 701 | 10/6/2022 |
| 1.2.7 | 620 | 9/13/2022 |
| 1.2.6 | 638 | 8/7/2022 |
| 1.2.5 | 4,187 | 5/3/2022 |
| 1.2.4 | 1,295 | 3/7/2022 |
| 1.2.3 | 6,269 | 12/2/2021 |
| 1.2.2 | 1,467 | 11/20/2021 |
v2.0.0 - Major performance improvements, .NET 8 only