Skip to content

Commit

Permalink
Don't remove state annotation more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Jul 1, 2019
1 parent 9ad2086 commit bd290d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/EFCore/Metadata/Conventions/NonNullableConventionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ protected virtual bool IsNonNullable(
/// <param name="modelBuilder"> The builder for the model. </param>
/// <param name="context"> Additional information associated with convention execution. </param>
public virtual void ProcessModelFinalized(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
=> modelBuilder.Metadata.RemoveAnnotation(StateAnnotationName);
{
if (modelBuilder.Metadata.FindAnnotation(StateAnnotationName) != null)
{
modelBuilder.Metadata.RemoveAnnotation(StateAnnotationName);
}
}

NonNullabilityConventionState GetOrInitializeState(IConventionModelBuilder modelBuilder)
=> (NonNullabilityConventionState)(
Expand Down

0 comments on commit bd290d5

Please sign in to comment.