From dabcf9a82575464ec72c700137180de809ee7d75 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 4 May 2026 16:57:16 +0200 Subject: [PATCH] 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> --- .../core/what-is-new/ef-core-11.0/provider-facing-changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md b/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md index 719b378cec..de4576876e 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md @@ -14,6 +14,7 @@ This page documents noteworthy changes in EF Core 11 which may affect EF provide * 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. * 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. +* 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. ## Test changes