Skip to content

Commit 20408d1

Browse files
Shay RojanskyCopilot
andcommitted
Document provider-facing breaking change: no-op SQL CAST stripping
Add a note to the EF Core 11 provider-facing changes page documenting that EF Core now strips SqlUnaryExpression(Convert) nodes when the store type matches the operand's store type. This can expose imprecise translations that relied on wrapping an imprecise store type in a Convert. Refs dotnet/efcore#36247, dotnet/efcore#38156 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4212763 commit 20408d1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ This page documents noteworthy changes in EF Core 11 which may affect EF provide
1515
* Collation names are now quoted in SQL, like column and table names ([see #37462](https://github.com/dotnet/efcore/issues/37462)). If your database doesn't support collation name quoting, override `QuerySqlGenerator.VisitSql()` and `MigrationsSqlGenerator.ColumnDefinition()` to revert to the previous behavior, but it's recommended to implement some sort of restricted character validation.
1616
* The `JsonPath` property on `IColumnModification` and `ColumnModificationParameters` has changed from `string?` to the new structured `JsonPath` type ([PR #38038](https://github.com/dotnet/efcore/pull/38038)). The `JsonPath` class provides `Segments`, `Ordinals`, an `IsRoot` property, and an `AppendTo(StringBuilder)` method for rendering the JSONPATH string. Providers that override `UpdateSqlGenerator.AppendUpdateColumnValue()` or otherwise handle JSON partial updates should update their code to use this new type. Where previously you checked for `null` or `"$"`, use `JsonPath is not { IsRoot: false }` instead, and call `JsonPath.AppendTo(stringBuilder)` to write the JSONPATH string representation.
1717

18+
* EF Core now strips no-op SQL CASTs - i.e. `SqlUnaryExpression(Convert)` nodes whose store type matches that of their operand ([see #36247](https://github.com/dotnet/efcore/issues/36247), [PR #38156](https://github.com/dotnet/efcore/pull/38156)). This can flush out imprecise translations which assigned an imprecise store type to a node and then wrapped it with a Convert; because the store types now match, the Convert is stripped, and the imprecise store type may propagate. Review your translations to ensure that the operand of a Convert node has the correct, precise store type.
19+
1820
## Test changes
1921

2022
* The inheritance specification tests have been reorganized into a folder of their own ([PR](https://github.com/dotnet/efcore/pull/37410)).

0 commit comments

Comments
 (0)