DataLinq v0.6.5 - LINQ Enhancements & Multi-Targeting
This release expands framework support to include .NET 8, 9, and 10, introduces significant improvements to the LINQ query parser for string manipulation and collection handling, and includes internal optimizations for newer .NET runtimes.
Highlights
- Multi-Targeting Support: DataLinq now explicitly targets .NET 8.0, .NET 9.0, and .NET 10.0.
- Performance Optimization on .NET 9+: Implemented conditional compilation to utilize the new
System.Threading.Lockon .NET 9 and greater, improving thread synchronization performance inImmutableRelationandImmutableForeignKey. - Advanced LINQ Chains: Added support for chained string functions in queries. You can now write LINQ expressions like
x.Name.Trim().Length, and they will correctly translate to the corresponding SQL.
LINQ & Query Engine
- Chained String Functions: The
QueryBuildernow supports parsing and generating SQL for chained string operations (e.g.,Trim().ToUpper().Length). - Enhanced Collection Handling: Improved translation logic for
ContainsandAnymethods.- Added robust handling for empty lists in
Containsqueries (resolving to1=0or1=1). - Fixed handling of negated
Containsconditions. - Added support for
op_Implicitcalls wrapping arrays or spans within queries.
- Added robust handling for empty lists in
- Entity Selection: Improved
QueryExecutorto handle selecting the full entity directly in projections (e.g.,source.Select(x => x)). - Expression Evaluation: Updated the
Evaluatorto safely handle non-reducible expressions (likeQuerySourceReferenceExpression), preventing runtime errors during partial evaluation of query trees.
Bug Fixes & Internal Improvements
- Dependency Update: Updated
ThrowAwaypackage to version 0.3.1 and updated various test dependencies (Bogus, xUnit, etc.). - SQL Generation: Added argument validation for
Substringfunctions in SQL providers to ensure correct usage. - Test Suite Reliability: Adjusted transaction tests to correctly account for isolation level differences between SQLite (which may expose uncommitted writes) and MySQL/MariaDB.
- Type Safety: Added specific handling to skip unsupported tests in MariaDB relating to GUID formats until upstream connector support is clarified.
Full Changelog: 0.6.4...0.6.5