Soenneker.Extensions.IQueryables
4.0.171
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Extensions.IQueryables --version 4.0.171
NuGet\Install-Package Soenneker.Extensions.IQueryables -Version 4.0.171
<PackageReference Include="Soenneker.Extensions.IQueryables" Version="4.0.171" />
<PackageVersion Include="Soenneker.Extensions.IQueryables" Version="4.0.171" />
<PackageReference Include="Soenneker.Extensions.IQueryables" />
paket add Soenneker.Extensions.IQueryables --version 4.0.171
#r "nuget: Soenneker.Extensions.IQueryables, 4.0.171"
#:package Soenneker.Extensions.IQueryables@4.0.171
#addin nuget:?package=Soenneker.Extensions.IQueryables&version=4.0.171
#tool nuget:?package=Soenneker.Extensions.IQueryables&version=4.0.171
Soenneker.Extensions.IQueryables
Builds deferred equality, range, text-search, and ordering expressions from runtime property names.
Installation
dotnet add package Soenneker.Extensions.IQueryables
Filter by a runtime field
using Soenneker.Extensions.IQueryables;
IQueryable<Order> query = dbContext.Orders;
query = query.WhereDynamicEquals("Status", "Open");
query = query.WhereDynamicRange(new RangeFilter
{
Field = "Total",
GreaterThanOrEqual = 100m,
LessThan = 500m
});
Field names are case-insensitive and can use either CLR property names or [JsonPropertyName] aliases. Dotted paths such as "Customer.Name" traverse public instance properties. Values are converted to the selected property type using invariant culture, including enums, GUIDs, dates, and nullable value types.
An equality comparison against null matches nullable/reference properties that are null. It never matches a non-nullable value property. Range bounds are combined with AND; a range with no bounds leaves the query unchanged.
Unknown fields, malformed paths, and values that cannot be converted fail while composing the query. Treat field names exposed through an API as an allowlisted contract rather than passing arbitrary client strings unchecked.
Search string properties
query = query.WhereDynamicSearch(
search: "acme",
fields: ["Customer.Name", "Reference"]);
Search creates an OR of string.Contains(search) across valid string fields. Blank field names and non-string properties are skipped; null string values do not match. Matching semantics, collation, and translation depend on the IQueryable provider. A blank search or empty field list leaves the query unchanged.
For LINQ-to-Objects, every intermediate object in a dotted path must be non-null. Database providers such as Entity Framework may translate navigation access with their own null semantics.
Apply dynamic ordering
IOrderedQueryable<Order> ordered = query.OrderByDynamic("CreatedAt", descending: true);
ordered = ordered.ThenByDynamic("Id", descending: false);
OrderByDynamic() creates the primary ordering. Call ThenByDynamic() only on an already ordered query. Property types remain strongly typed in the generated expression; values are not converted to strings for sorting.
Apply request options
IQueryable<Order> filtered = query.AddRequestDataOptions(options);
AddRequestDataOptions() combines all exact filters, range filters, and search into one Where predicate, then applies order entries in list order. Exact filters and range filters are joined with AND; search fields are joined with OR and the complete search clause is joined to the filters with AND.
It does not apply PageSize, ContinuationToken, or IncludeCount; paging and counting remain the caller's responsibility. All methods return deferred queries and do not execute or materialize them.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Soenneker.Dtos.RequestDataOptions (>= 4.0.192)
- Soenneker.Extensions.String (>= 4.0.729)
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 |
|---|---|---|
| 4.0.177 | 69 | 8/31/2026 |
| 4.0.176 | 71 | 8/31/2026 |
| 4.0.175 | 69 | 8/31/2026 |
| 4.0.174 | 73 | 8/31/2026 |
| 4.0.173 | 72 | 8/31/2026 |
| 4.0.172 | 86 | 8/30/2026 |
| 4.0.171 | 85 | 8/30/2026 |
| 4.0.170 | 81 | 8/30/2026 |
| 4.0.169 | 72 | 8/30/2026 |
| 4.0.168 | 92 | 8/29/2026 |
| 4.0.167 | 81 | 8/29/2026 |
| 4.0.166 | 98 | 8/26/2026 |
| 4.0.165 | 83 | 8/25/2026 |
| 4.0.164 | 96 | 8/21/2026 |
| 4.0.163 | 136 | 8/18/2026 |
| 4.0.162 | 83 | 8/18/2026 |
| 4.0.161 | 89 | 8/18/2026 |
| 4.0.160 | 90 | 8/18/2026 |
| 4.0.159 | 131 | 8/12/2026 |
| 4.0.158 | 103 | 8/8/2026 |
Update dependency Soenneker.Extensions.String to 4.0.729 (#369)