/// <summary> /// Configures the default increment for SQL Server IDENTITY. /// </summary> /// <param name="modelBuilder"> The model builder. </param> /// <param name="increment"> The incremental value that is added to the identity value of the previous row that was loaded. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> /// <returns> /// The same builder instance if the configuration was applied, /// <c>null</c> otherwise. /// </returns> public static IConventionModelBuilder HasIdentityColumnIncrement( [NotNull] this IConventionModelBuilder modelBuilder, int?increment, bool fromDataAnnotation = false) { if (modelBuilder.CanSetIdentityColumnIncrement(increment, fromDataAnnotation)) { modelBuilder.Metadata.SetIdentityIncrement(increment, fromDataAnnotation); return(modelBuilder); } return(null); }