Installation
DynamicWhere.ex is published on NuGet. It targets .NET 6+ and plugs into any project that already uses Entity Framework Core.
dotnet CLI
dotnet add package DynamicWhere.ex --version 3.4.0Package Manager (Visual Studio)
Install-Package DynamicWhere.ex -Version 3.4.0PackageReference (csproj)
<ItemGroup>
<PackageReference Include="DynamicWhere.ex" Version="3.4.0" />
</ItemGroup>Dependencies
DynamicWhere.ex depends on the following packages — restore will pull them automatically. Versions are pinned to the floor; newer compatible releases are picked up by default unless your project locks them down.
| Package | Version | Why |
|---|---|---|
Microsoft.EntityFrameworkCore | 6.0.22 | Provides IQueryable<T>, CountAsync, ToListAsync, ToQueryString. |
System.Linq.Dynamic.Core | 1.6.7 | Enables string-based Select / OrderBy / GroupBy used by the dynamic variants. |
Microsoft.Extensions.Caching.Memory | 6.0.2 | Not used directly. EF Core 6.0.22 asks for 6.0.1 or later, and 6.0.1 is the last version open to CVE-2024-43483, so naming 6.0.2 raises the floor for all four packages (3.3.0). A host on EF Core 8 or later already resolves a newer one. |
Microsoft.Extensions.Configuration.Abstractions | 6.0.0 | Provides IConfiguration, the section DwPolicyOptions and DwDateOptions bind from. |
Microsoft.Extensions.Configuration.Binder | 6.0.0 | Binds that section, and refuses a key nothing answers to. |
Microsoft.Extensions.DependencyInjection.Abstractions | 6.0.0 | Provides IServiceCollection, for AddDwPolicies. |
Namespaces you'll import
The most common usings:
using DynamicWhere.ex.Source; // Extension methods
using DynamicWhere.ex.Classes.Core; // Condition, ConditionGroup, OrderBy, PageBy, ...
using DynamicWhere.ex.Classes.Complex; // Filter, Segment, Summary
using DynamicWhere.ex.Classes.Result; // FilterResult, SegmentResult, SummaryResult
using DynamicWhere.ex.Enums; // DataType, Operator, Connector, ...
using DynamicWhere.ex.Optimization.Cache.Source; // CacheExpose
using DynamicWhere.ex.Optimization.Cache.Config; // CacheOptions
using DynamicWhere.ex.Optimization.Cache.Enums; // CacheEvictionStrategy, CacheMemoryTypeVerify the install
The fastest sanity check is a one-liner against an existing DbSet:
var count = await db.Customers
.Where(new Condition
{
Sort = 1,
Field = "Id",
DataType = DataType.Number,
Operator = Operator.GreaterThan,
Values = new List<object> { 0 }
})
.CountAsync();Note
Once that compiles and runs, you're good. Move on to Quick Start for a full filter end-to-end.
Compatibility notes
- Target framework: .NET 6, .NET 7, .NET 8, .NET 9, .NET 10.
- EF Core provider: any provider that supports
ToQueryString()works for the optionalgetQueryString: trueflag. SQL Server, PostgreSQL (Npgsql), MySQL (Pomelo), and SQLite are all known to work. - Database collation: case-insensitive
I*operators emit.ToLower()on both sides. See Breaking Changes for performance notes. - Enum storage: the
Enumdata type compares the member name you send, and works whether the column stores names or integers. See Breaking Changes.