Skip to content

Commit

Permalink
Add quirk mode for #26611
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriySvyryd committed Nov 17, 2021
1 parent f5d7895 commit 5acbe48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/EFCore/Metadata/Internal/InternalForeignKeyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,12 @@ private static bool IsCompatible(
Metadata.DeclaringEntityType.Model.ScopedModelDependencies?.Logger.AmbiguousEndRequiredWarning(Metadata);
}

if (AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue26611", out var enabled) && enabled)
{
Metadata.SetIsRequired(required, configurationSource);
return this;
}

IConventionForeignKey? foreignKey = Metadata;
var result = Metadata.DeclaringEntityType.Model.ConventionDispatcher.Track(
() => Metadata.SetIsRequired(required, configurationSource), ref foreignKey);
Expand Down

0 comments on commit 5acbe48

Please sign in to comment.