DynamicWhere.ex
DynamicWhere.exv2.1.0·docs

Extension Methods

Every extension method lives in DynamicWhere.ex.Source.Extension and operates on IQueryable<T> — with IEnumerable<T> overloads for in-memory variants. The methods fall into four intents: projection, filtering, composition, and materialization.

Projection

Project a query into a typed shape or a dynamic shape. Both support direct properties, whole navigation objects, whole collections, and dotted paths through reference and collection navigations.

MethodSignatureReturnsAsyncLink
Select.Select<T>(List<string> fields)IQueryable<T>NoDocs
SelectDynamic.SelectDynamic<T>(List<string> fields)IQueryableNoDocs

Filtering

Build the where-clause, group, order, or paginate the query — one building block at a time.

MethodSignatureReturnsAsyncLink
Where.Where<T>(Condition condition)IQueryable<T>NoDocs
Where.Where<T>(ConditionGroup group)IQueryable<T>NoDocs
Group.Group<T>(GroupBy groupBy)IQueryableNoDocs
Order.Order<T>(OrderBy) / .Order<T>(List<OrderBy>)IQueryable<T>NoDocs
Page.Page<T>(PageBy page)IQueryable<T>NoDocs

Composition

Apply a complete Filter or Summary composition to the query. Each returns an IQueryable so you can chain further operations before materializing.

MethodSignatureReturnsAsyncLink
Filter.Filter<T>(Filter filter)IQueryable<T>NoDocs
FilterDynamic.FilterDynamic<T>(Filter filter)IQueryableNoDocs
Summary.Summary<T>(Summary summary)IQueryableNoDocs

Materialization

Execute the composed query and return a paginated result — typed, dynamic, summary, or segment. The async overloads call EF Core's CountAsync and ToListAsync / ToDynamicListAsync under the hood.

MethodSignatureReturnsAsyncLink
ToList (Filter).ToList<T>(Filter, bool getQueryString = false)FilterResult<T>NoDocs
ToListAsync (Filter).ToListAsync<T>(Filter, bool getQueryString = false)Task<FilterResult<T>>YesDocs
ToListDynamic (Filter).ToListDynamic<T>(Filter, bool getQueryString = false)FilterResult<dynamic>NoDocs
ToListAsyncDynamic (Filter).ToListAsyncDynamic<T>(Filter, bool getQueryString = false)Task<FilterResult<dynamic>>YesDocs
ToList (Summary).ToList<T>(Summary, bool getQueryString = false)SummaryResultNoDocs
ToListAsync (Summary).ToListAsync<T>(Summary, bool getQueryString = false)Task<SummaryResult>YesDocs
ToListAsync (Segment).ToListAsync<T>(Segment segment)Task<SegmentResult<T>>Yes (only)Docs
Warning
Segment operations are async-only. There is no synchronous ToList<T>(Segment) variant. Each ConditionSet is materialized independently into memory, then set operations (Union / Intersect / Except) execute in-memory before ordering and pagination.

In-memory overloads

The ToList / ToListDynamic (Filter and Summary) extensions also expose IEnumerable<T> overloads. These wrap the collection with AsQueryable() and delegate to the typed overload — handy for unit tests and in-process pipelines.

Note
Pass getQueryString: true to any materialization call to capture the generated SQL on the result. This requires an active EF Core provider; pure IEnumerable<T> use may not support .ToQueryString().

Next steps

  • Filter — the JSON shape that drives the typed pipeline.
  • Summary — the aggregate-reporting pipeline.
  • Segment — set operations across multiple condition sets.