From ea9106076040480b1efa2a0f53cba4540631b9cf Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Thu, 4 May 2023 17:58:15 +0100 Subject: [PATCH] Re-introduce quirk with typo (#30825) --- .../Update/Internal/SqlServerUpdateSqlGenerator.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs b/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs index 0ee5b050f26..f2928c26c79 100644 --- a/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs +++ b/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs @@ -18,6 +18,9 @@ public class SqlServerUpdateSqlGenerator : UpdateAndSelectSqlGenerator, ISqlServ private static readonly bool UseOldBehavior30330 = AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue30330", out var enabled30330) && enabled30330; + private static readonly bool LegacyUseOldBehavior30330 + = AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue30330 ", out var enabled30330) && enabled30330; + /// /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in @@ -159,7 +162,7 @@ protected override void AppendUpdateColumnValue( if (columnModification.Property != null) { bool needsTypeConversion; - if (!UseOldBehavior30330) + if (!UseOldBehavior30330 && !LegacyUseOldBehavior30330) { var propertyClrType = columnModification.Property.GetTypeMapping().Converter?.ProviderClrType ?? columnModification.Property.ClrType;