Skip to content

Releases: EFNext/ExpressiveSharp

v0.5.0

13 Apr 23:55
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

v0.5.0 Pre-release
Pre-release

Projectable properties

New [Expressive(Projectable = true)] marks a property as projection-middleware compatible,
letting ExpressiveSharp interop with patterns from libraries like EntityFrameworkCore.Projectables.
The generator recognizes two backing patterns (field keyword and manual backing field), emits
diagnostics for unsupported shapes, and integrates with MongoDB via the new
ExpressiveMongoIgnoreConvention so projectable backing fields aren't persisted to BSON.

See the new Projection middleware recipe and
Projectable properties reference.

Broader constructor support

The generator now handles more constructor shapes inside [Expressive] bodies:

  • Record primary constructors without a parameterless constructor
  • Tuple deconstruction assignment ((a, b) = expr)
  • Cleaner emission for : this(...) / : base(...) initializer chains

Switch statements with return arms

Switch statements whose arms return now lower correctly to expression trees, expanding what
you can write in block-bodied [Expressive] members.

MongoDB convention registration

ExpressiveMongoIgnoreConvention can now be registered via the AsExpressive() extension path
(not just the collection constructor). A startup helper
ExpressiveMongoIgnoreConvention.EnsureRegistered() is recommended to avoid ordering issues with
MongoDB's eager class-map caching.

Diagnostics

New diagnostic codes for [Expressive(Projectable = true)] validation (EXP0021–EXP0026 range),
including rejection of static backing fields to preserve per-instance semantics.

Docs & samples

  • Projectable pages aligned with reference/recipe conventions
  • Dropped Cosmos DB as a sample target

Full Changelog: v0.4.0...v0.5.0

v0.4.0

13 Apr 02:39
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

v0.4.0 Pre-release
Pre-release

MongoDB is here

The new ExpressiveSharp.MongoDB package gives you ExpressiveMongoCollection<T> and IRewritableMongoQueryable<T>, decorating Mongo's query provider so [Expressive] members expand before the driver translates to BSON. Async LINQ is wired up via [PolyfillTarget(typeof(MongoQueryable))] — the same syntax you write against EF Core now works against Mongo.

SQL window functions

The experimental ExpressiveSharp.EntityFrameworkCore.RelationalExtensions package translates all three window-function families — ranking, aggregate (with ROWS/RANGE frames), and navigation (LAG, LEAD, FIRST_VALUE, etc.) — to provider-agnostic SQL:2003. A type-safe fluent builder ensures you can only put a frame on a function that accepts one. Opt in per-DbContext with UseExpressives(o => o.UseRelationalExtensions()).

Throw expressions

throw now works inside [Expressive] bodies, so x ?? throw new InvalidOperationException() and similar idioms compile to expression trees and translate at the provider.

Lighter abstractions package

Library authors can now depend on just ExpressiveSharp.Abstractions — attributes and the source generator, nothing else. Consumers pull in the full ExpressiveSharp runtime only when they actually execute queries.

Better string interpolation

Multi-arg string.Concat overloads are used when possible, alignment specifiers are handled cleanly, and floats no longer emit 1,5 on non-English locales.


Breaking changes

IRewritableQueryable<T>IExpressiveQueryable<T>. The old name leaked an implementation detail. Rename your call sites.

LINQ extensions moved to the ExpressiveSharp namespace. Add using ExpressiveSharp; where you call .AsExpressive(), .ExpandExpressives(), or intercepted LINQ methods. New analyzers EXP0021 / EXP0022 detect the missing directive and offer a code fix.

What's Changed

  • Revamp integration tests to hit the database by @koenbeuk in #22
  • Add ExpressiveSharp.Abstractions package by @koenbeuk in #20
  • Implement support for throw expressions in expression trees by @koenbeuk in #19
  • Add aggregate and navigation window functions with ROWS/RANGE frame support by @koenbeuk in #23
  • Improve string interpolation: multi-arg Concat, alignment fix, docs, and transformer by @koenbeuk in #21
  • Rename IRewritableQueryable to IExpressiveQueryable by @koenbeuk in #24
  • Fix Rider tests discovery and remove unused file by @PhenX in #27
  • Update Cosmos tests to handle unsupported scenarios with inconclusive assertions by @koenbeuk in #26
  • MongoDB integration by @koenbeuk in #25
  • Fix i18n issues on floating point numbers in generated source code by @PhenX in #28
  • Add vitepress-plugin-llms as a dev dependency by @koenbeuk in #29
  • Enhance documentation workflow and add Blazor WASM playground support by @koenbeuk in #30
  • Fix docs deploy: disable AOT on Playground.Wasm by @koenbeuk in #32

New Contributors

  • @PhenX made their first contribution in #27

Full Changelog: v0.3.1...v0.4.0

v0.3.1

04 Apr 14:33
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

v0.3.1 Pre-release
Pre-release

Fix captured variable translation in polyfill interceptor lambdas, preventing EF Core query failures when AsExpressive() lambdas reference outer-scope variables, instance members, or auto-properties.

Full Changelog: v0.3.0...v0.3.1

v0.3.0

03 Apr 23:51
Immutable release. Only release title and notes can be modified.
81a4f05

Choose a tag to compare

v0.3.0 Pre-release
Pre-release

Features

  • EF Core ExecuteUpdate supportIRewritableQueryable<T> now supports ExecuteUpdate and ExecuteUpdateAsync with full expression rewriting, enabling modern C# syntax in bulk update statements. (#6)
  • Automatic DbSet discovery — New ExpressiveDbSetDiscoveryConvention automatically discovers ExpressiveDbSet<T> properties on your DbContext, removing the need for manual configuration.

Improvements

  • More precise generic type-parameter disambiguation in reflection lookups using IsGenericParameter.
  • Use StringBuilder in ReflectionFieldCache for parameter check generation.
  • Improved test coverage for the EXP0013 diagnostic.

Breaking Changes

  • The opt-in method for enabling expressives has been renamed. Update your call sites accordingly.

Docs

  • Added EF Core guide for ExecuteUpdate usage.

Full Changelog: v0.2.1...v0.3.0

v0.2.1

31 Mar 01:05
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

v0.2.1 Pre-release
Pre-release
  • Added .NET 9 target framework — all runtime libraries, tests, benchmarks, and samples now target net8.0, net9.0, and net10.0
  • Consolidated on C# 14 — LangVersion is now 14.0 across all TFMs (previously 12.0 on net8.0)
  • AggregateBy support — added AggregateBy stub to IRewritableQueryable and polyfill interceptor generation for the .NET 9+ LINQ method
  • Major PolyfillInterceptorGenerator refactor — rewrote multi-lambda detection and emission logic; the generator now tracks all Func<> parameter indices instead of only the first, improving correctness for complex method signatures
  • UseExpressives order independence — UseRelationalExtensions() now works regardless of whether it's called before or after the EF Core provider is registered (deferred service decoration)
  • Reversed-order UseExpressives context creation — added builder methods and tests for configuring expressive options in reversed registration order
  • Expanded test coverage — added missing diagnostic tests (EXP0001–EXP0020), AggregateBy integration tests, UseExpressives ordering tests, and window function integration tests
  • Documentation & CI — added troubleshooting section to docs, Codecov upload in CI, fixed README badge/links, removed icon from README

Full Changelog: v0.2.0...v0.2.1

v0.2.0

30 Mar 01:53
Immutable release. Only release title and notes can be modified.
afcbb05

Choose a tag to compare

v0.2.0 Pre-release
Pre-release

What's Changed

  • fix: Emit string.Concat instead of Expression.Add for string + operator by @koenbeuk in #2
  • Add BenchmarkDotNet benchmarks and manual workflow trigger by @koenbeuk in #1
  • Consolidate generated expression classes into partial classes by @koenbeuk in #3
  • Introduce ExpressiveFor and ExpressiveForConstructor attributes by @koenbeuk in #4
  • Add missing LINQ overloads for IRewritableQueryable by @koenbeuk in #5
  • Add support for SQL window functions in ExpressiveSharp.EntityFrameworkCore by @koenbeuk in #10
  • Added docs site by @koenbeuk in #12
  • fix: improve benchmark stability and adjust alert threshold by @koenbeuk in #15
  • Add RelationalExtensions.Abstractions for SQL window functions by @koenbeuk in #16
  • Refactor ExpressionTreeEmitter and ReflectionFieldCache to remove field prefix and static field handling by @koenbeuk in #11
  • Refactor code structure for improved readability and maintainability by @koenbeuk in #14

Full Changelog: v0.1.0...v0.2.0

v0.1.0

25 Mar 18:57

Choose a tag to compare

v0.1.0 Pre-release
Pre-release