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; ///