From 1ddc0d95a3af8526ad27442ce1d2b87b8933d5f7 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Fri, 11 Mar 2022 11:46:42 +0000 Subject: [PATCH] Remove quirks --- src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs | 5 +---- src/EFCore/Metadata/Internal/PropertyExtensions.cs | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs b/src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs index 7faa07590dc..94d13cf4851 100644 --- a/src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs +++ b/src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs @@ -1445,9 +1445,6 @@ public void AcceptChanges() } } - private readonly static bool _useOldBehavior27455 = - AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue27455", out var enabled27455) && enabled27455; - /// /// 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 @@ -1475,7 +1472,7 @@ public InternalEntityEntry PrepareToSave() if (property.IsKey() && property.IsForeignKey() && _stateData.IsPropertyFlagged(property.GetIndex(), PropertyFlag.Unknown) - && (_useOldBehavior27455 || !IsStoreGenerated(property))) + && !IsStoreGenerated(property)) { if (property.GetContainingForeignKeys().Any(fk => fk.IsOwnership)) { diff --git a/src/EFCore/Metadata/Internal/PropertyExtensions.cs b/src/EFCore/Metadata/Internal/PropertyExtensions.cs index c60ea556661..f0714f44d7f 100644 --- a/src/EFCore/Metadata/Internal/PropertyExtensions.cs +++ b/src/EFCore/Metadata/Internal/PropertyExtensions.cs @@ -70,9 +70,6 @@ public static bool ForUpdate(this ValueGenerated valueGenerated) return null; } - private readonly static bool _useOldBehavior27455 = - AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue27455", out var enabled27455) && enabled27455; - /// /// 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 @@ -84,8 +81,7 @@ public static bool RequiresValueGenerator(this IReadOnlyProperty property) && property.IsKey() && (!property.IsForeignKey() || property.IsForeignKeyToSelf() - || (!_useOldBehavior27455 - && property.GetContainingForeignKeys().All(fk => fk.Properties.Any(p => p != property && p.IsNullable))))) + || (property.GetContainingForeignKeys().All(fk => fk.Properties.Any(p => p != property && p.IsNullable))))) || property.GetValueGeneratorFactory() != null; ///