/// <summary> /// Sets the default schema. /// </summary> /// <param name="model"> The model to set the default schema for. </param> /// <param name="value"> The value to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetDefaultSchema( [NotNull] this IConventionModel model, [CanBeNull] string value, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation( RelationalAnnotationNames.DefaultSchema, Check.NullButNotEmpty(value, nameof(value)), fromDataAnnotation);
/// <summary> /// Attempts to set the <see cref="SqlServerValueGenerationStrategy" /> to use for properties /// of keys in the model that don't have a strategy explicitly set. /// </summary> /// <param name="model"> The model. </param> /// <param name="value"> The value to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetSqlServerValueGenerationStrategy( [NotNull] this IConventionModel model, SqlServerValueGenerationStrategy?value, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation(SqlServerAnnotationNames.ValueGenerationStrategy, value, fromDataAnnotation);
/// <summary> /// Sets the maximum length allowed for store identifiers. /// </summary> /// <param name="model"> The model to set the default schema for. </param> /// <param name="length"> The value to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetMaxIdentifierLength([NotNull] this IConventionModel model, int?length, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation(RelationalAnnotationNames.MaxIdentifierLength, length, fromDataAnnotation);
public static void SetValueGenerationStrategy(this IConventionModel model, FbValueGenerationStrategy?value, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation(FbAnnotationNames.ValueGenerationStrategy, value, fromDataAnnotation);
/// <summary> /// Sets the default identity increment. /// </summary> /// <param name="model"> The model. </param> /// <param name="increment"> The value to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetSqlServerIdentityIncrement( [NotNull] this IConventionModel model, int?increment, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation( SqlServerAnnotationNames.IdentityIncrement, increment, fromDataAnnotation);
/// <summary> /// Sets the default container name. /// </summary> /// <param name="model"> The model. </param> /// <param name="name"> The name to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetCosmosDefaultContainer( [NotNull] this IConventionModel model, [CanBeNull] string name, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation( CosmosAnnotationNames.ContainerName, Check.NullButNotEmpty(name, nameof(name)), fromDataAnnotation);
/// <summary> /// Sets the default collation for all columns in the database, or <c>null</c> if none is defined. /// This causes EF Core to specify an explicit collation when creating all column, unless one is overridden /// on a column. /// </summary> /// <remarks> /// <p> /// See <see cref="RelationalModelExtensions.SetCollation(Microsoft.EntityFrameworkCore.Metadata.IMutableModel,string)" /> /// for another approach to defining a database-wide collation. /// </p> /// <p> /// For more information, see https://www.postgresql.org/docs/current/collation.html. /// </p> /// </remarks> public static string?SetDefaultColumnCollation(this IConventionModel model, string?collation, bool fromDataAnnotation = false) { model.SetOrRemoveAnnotation(NpgsqlAnnotationNames.DefaultColumnCollation, collation, fromDataAnnotation); return(collation); }
/// <summary> /// Sets the maximum length allowed for store identifiers. /// </summary> /// <param name="model">The model to set the default schema for.</param> /// <param name="length">The value to set.</param> /// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param> /// <returns>The configured value.</returns> public static int?SetMaxIdentifierLength(this IConventionModel model, int?length, bool fromDataAnnotation = false) { model.SetOrRemoveAnnotation(RelationalAnnotationNames.MaxIdentifierLength, length, fromDataAnnotation); return(length); }
/// <summary> /// Attempts to set the character set to use as the default for the model/database. /// </summary> /// <param name="model"> The model. </param> /// <param name="charSet"> The default character set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetCharSet([NotNull] this IConventionModel model, string charSet, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation(MySqlAnnotationNames.CharSet, charSet, fromDataAnnotation);
/// <summary> /// Sets the default identity seed. /// </summary> /// <param name="model"> The model. </param> /// <param name="seed"> The value to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetIdentitySeed([NotNull] this IConventionModel model, int?seed, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation( SqlServerAnnotationNames.IdentitySeed, seed, fromDataAnnotation);
/// <summary> /// Sets the default collation for all columns in the database, or <c>null</c> if none is defined. /// This causes EF Core to specify an explicit collation when creating all column, unless one is overridden /// on a column. /// </summary> /// <remarks> /// <p> /// See <see cref="RelationalModelExtensions.SetCollation(Microsoft.EntityFrameworkCore.Metadata.IMutableModel,string)" /> /// for another approach to defining a database-wide collation. /// </p> /// <p> /// For more information, see https://www.postgresql.org/docs/current/collation.html. /// </p> /// </remarks> public static string SetDefaultColumnCollation([NotNull] this IConventionModel model, [CanBeNull] string collation, bool fromDataAnnotation = false) { model.SetOrRemoveAnnotation(NpgsqlAnnotationNames.DefaultColumnCollation, collation, fromDataAnnotation); return(collation); }
/// <summary> /// Sets the performance level of the database. /// </summary> /// <param name="model"> The model. </param> /// <param name="value"> The value to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetPerformanceLevel( [NotNull] this IConventionModel model, [CanBeNull] string value, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation(SqlServerAnnotationNames.PerformanceLevel, value, fromDataAnnotation);
/// <summary> /// Sets the service tier of the database. /// </summary> /// <param name="model"> The model. </param> /// <param name="value"> The value to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetServiceTier( [NotNull] this IConventionModel model, [CanBeNull] string value, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation(SqlServerAnnotationNames.ServiceTier, value, fromDataAnnotation);
/// <summary> /// Sets the maximum size of the database. /// </summary> /// <param name="model"> The model. </param> /// <param name="value"> The value to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetDatabaseMaxSize( [NotNull] this IConventionModel model, [CanBeNull] string value, bool fromDataAnnotation = false) => model.SetOrRemoveAnnotation(SqlServerAnnotationNames.MaxDatabaseSize, value, fromDataAnnotation);