Skip to content

Release of v1.0.3

Choose a tag to compare

@tibold tibold released this 18 Mar 15:47
· 85 commits to main since this release

Release of v1.0.3
Bug Fixes
Fix enum mapper expression translation for Npgsql (PostgreSQL) and other SQL providers. The EnumMapper conditional expression tree wrapped the entire result in Expression.Convert(body, typeof(TDest)) to cast the integer chain back to the destination enum type. While SQLite and SQL Server could translate this, the Npgsql provider could not, producing:

System.InvalidOperationException: The LINQ expression '...' could not be translated.
Destination constants are now emitted as enum-typed values directly, so the conditional chain naturally produces TDest without a provider-untranslatable conversion. This completes the fix started in v1.0.2 (9d7ce94), which correctly moved the comparison side to integers but inadvertently introduced an untranslatable outer cast on the result side.
Tests
Added PostgreSQL integration tests using Testcontainers to verify enum mapping expression translation against a real Npgsql provider — standalone enum projection and enum inlined in a parent mapper projection.