Skip to content

Added queryable and enumerable composable expression overloads for condition terminals ordering grouping and flattening - #4

Merged
ycherkes merged 4 commits into
mainfrom
added-queryable-and-enumerable-composable-expression-overloads-for-condition-terminals-ordering-grouping-and-flattening
Aug 25, 2026
Merged

ycherkes merged 4 commits into
mainfrom
added-queryable-and-enumerable-composable-expression-overloads-for-condition-terminals-ordering-grouping-and-flattening

Conversation

@ycherkes

@ycherkes ycherkes commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR expands composable-expression support across LINQ method and query syntax while preserving the underlying query provider.

  • Adds IEnumerable<T> and IQueryable<T> overloads for condition terminals, ordering, grouping, projection, and flattening.
  • Introduces the covariant IComposableExpression<TSource, out TResult> consumption contract.
  • Allows SelectMany projections returning concrete sequence types such as List<T> and arrays without calling AsEnumerable().
  • Keeps ComposableExpression<TSource, TResult> public as the supported base for custom semantic wrappers, expansion, and delegate caching.
  • Adds the opt-in Raffinert.Expressions.QuerySyntax package targeting netstandard2.1.
  • Adds AsRaffinertQuery() for expanding composition markers throughout C# query syntax without replacing the underlying provider.
  • Supports multiple from clauses, joins, group joins, ordering, grouping, continuations, and async enumeration.
  • Keeps the core package dependency-free on netstandard2.0.

Implementation details

  • LINQ extensions consistently consume IComposableExpression.
  • Queryable operators reconstruct typed expressions only when covariance requires adaptation; matching expression types retain their cached instance.
  • The query-syntax facade delegates expression, provider, enumeration, and execution to the wrapped query.
  • Added an internal expansion entry point shared with the query-syntax package.
  • Added provider-independent ToListAsync() and ToArrayAsync() facade methods.
  • Updated package metadata, documentation, changelog, solution structure, and CI packaging.

Packages

  • Raffinert.Expressions remains on netstandard2.0.
  • Raffinert.Expressions.QuerySyntax targets netstandard2.1 and references the core package.
  • CI packs and uploads both NuGet and symbol packages.

Testing

  • Added unit coverage for all enumerable and queryable extensions.
  • Added interface-typed, covariance, List<T>, array, and custom-wrapper coverage.
  • Added query-syntax tests covering filtering, projection, multiple from, joins, grouping, ordering, and continuations.
  • Added EF Core SQLite integration coverage for expansion, SQL translation, provider preservation, and asynchronous execution.
  • All 60 tests pass with zero warnings and errors.

…condition terminals, ordering, grouping, and flattening.

- Added unit coverage for the full extension surface and EF Core SQLite coverage for expression expansion and translation.
  - add public covariant IComposableExpression interface
  - accept the interface across enumerable and queryable LINQ extensions
  - support List<T>, arrays, and compatible sequences in SelectMany
  - preserve typed expanded expressions when no adaptation is needed
  - retain ComposableExpression as the public custom-wrapper base
  - add EF, covariance, interface-consumer, and extensibility coverage
  - document the consumption and inheritance API roles
  - remove the net472 compatibility project from the solution
  - remove its Windows CI build and execution steps
  - remove the obsolete compatibility-check changelog entry
@ycherkes
ycherkes merged commit 070ac6d into main Aug 25, 2026
2 checks passed
@ycherkes
ycherkes deleted the added-queryable-and-enumerable-composable-expression-overloads-for-condition-terminals-ordering-grouping-and-flattening branch August 25, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant