public override Annotation Apply(InternalPropertyBuilder propertyBuilder, string name, Annotation annotation, Annotation oldAnnotation) { if (annotation == null || oldAnnotation?.Value != null) { return(annotation); } var configurationSource = ((IConventionAnnotation)annotation).GetConfigurationSource(); var fromDataAnnotation = configurationSource != ConfigurationSource.Convention; switch (name) { case RelationalAnnotationNames.DefaultValue: if (propertyBuilder.ForSqlServerHasValueGenerationStrategy(null, fromDataAnnotation) == null && propertyBuilder.HasDefaultValue(null, fromDataAnnotation) != null) { return(null); } break; case RelationalAnnotationNames.DefaultValueSql: if (propertyBuilder.ForSqlServerHasValueGenerationStrategy(null, fromDataAnnotation) == null && propertyBuilder.HasDefaultValueSql(null, fromDataAnnotation) != null) { return(null); } break; case RelationalAnnotationNames.ComputedColumnSql: if (propertyBuilder.ForSqlServerHasValueGenerationStrategy(null, fromDataAnnotation) == null && propertyBuilder.HasComputedColumnSql(null, fromDataAnnotation) != null) { return(null); } break; case SqlServerAnnotationNames.ValueGenerationStrategy: if (propertyBuilder.HasDefaultValue(null, fromDataAnnotation) == null | propertyBuilder.HasDefaultValueSql(null, fromDataAnnotation) == null | propertyBuilder.HasComputedColumnSql(null, fromDataAnnotation) == null) { return(propertyBuilder.ForSqlServerHasValueGenerationStrategy(null, fromDataAnnotation) == null ? annotation : null); } break; } return(base.Apply(propertyBuilder, name, annotation, oldAnnotation)); }