/// <summary> /// Sets the foreign key constraint name. /// </summary> /// <param name="foreignKey"> The foreign key. </param> /// <param name="value"> The value to set. </param> public static void SetConstraintName([NotNull] this IMutableForeignKey foreignKey, [CanBeNull] string value) => foreignKey.SetOrRemoveAnnotation( RelationalAnnotationNames.Name, Check.NullButNotEmpty(value, nameof(value)));
/// <summary> /// Sets the SQL expression that is used as the computed value for the column this property is mapped to. /// </summary> /// <param name="property"> The property. </param> /// <param name="value"> The value to set. </param> public static void SetComputedColumnSql([NotNull] this IMutableProperty property, [CanBeNull] string value) => property.SetOrRemoveAnnotation( RelationalAnnotationNames.ComputedColumnSql, Check.NullButNotEmpty(value, nameof(value)));
/// <summary> /// Sets the column to which the property is mapped. /// </summary> /// <param name="property"> The property. </param> /// <param name="name"> The name to set. </param> public static void SetColumnName([NotNull] this IMutableProperty property, [CanBeNull] string name) => property.SetOrRemoveAnnotation( RelationalAnnotationNames.ColumnName, Check.NullButNotEmpty(name, nameof(name)));
/// <summary> /// Sets the name to use for the default hi-lo sequence. /// </summary> /// <param name="model"> The model. </param> /// <param name="name"> The value to set. </param> public static void SetHiLoSequenceName(this IMutableModel model, string?name) { Check.NullButNotEmpty(name, nameof(name)); model.SetOrRemoveAnnotation(SqlServerAnnotationNames.HiLoSequenceName, name); }
public static IReadOnlySequence?FindSequence( [NotNull] this IReadOnlyModel model, [NotNull] string name, [CanBeNull] string?schema = null) => Sequence.FindSequence( Check.NotNull(model, nameof(model)), Check.NotEmpty(name, nameof(name)), Check.NullButNotEmpty(schema, nameof(schema)));
/// <summary> /// Sets the name of the parent property to which the entity type is mapped. /// </summary> /// <param name="entityType"> The entity type to set the containing property name for. </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 SetContainingPropertyName( [NotNull] this IConventionEntityType entityType, [CanBeNull] string name, bool fromDataAnnotation = false) => entityType.SetOrRemoveAnnotation( CosmosAnnotationNames.PropertyName, Check.NullButNotEmpty(name, nameof(name)), fromDataAnnotation);
/// <summary> /// Sets the name of the table to which the entity type is mapped. /// </summary> /// <param name="entityType"> The entity type to set the table name for. </param> /// <param name="name"> The name to set. </param> public static void SetTableName([NotNull] this IMutableEntityType entityType, [CanBeNull] string name) => entityType.SetOrRemoveAnnotation( RelationalAnnotationNames.TableName, Check.NullButNotEmpty(name, nameof(name)));
/// <summary> /// Sets the database schema that contains the mapped view. /// </summary> /// <param name="entityType">The entity type to set the view schema for.</param> /// <param name="value">The value to set.</param> public static void SetViewSchema(this IMutableEntityType entityType, string?value) => entityType.SetAnnotation( RelationalAnnotationNames.ViewSchema, Check.NullButNotEmpty(value, nameof(value)));
/// <summary> /// Sets the name of the table to which the entity type is mapped. /// </summary> /// <param name="entityType">The entity type to set the table name for.</param> /// <param name="name">The name to set.</param> public static void SetTableName(this IMutableEntityType entityType, string?name) => entityType.SetAnnotation( RelationalAnnotationNames.TableName, Check.NullButNotEmpty(name, nameof(name)));
/// <summary> /// Sets the schema to use for the default hi-lo sequence. /// </summary> /// <param name="model"> The model. </param> /// <param name="value"> The value to set. </param> public static void SetHiLoSequenceSchema([NotNull] this IMutableModel model, [CanBeNull] string value) { Check.NullButNotEmpty(value, nameof(value)); model.SetOrRemoveAnnotation(NpgsqlAnnotationNames.HiLoSequenceSchema, value); }
/// <summary> /// Sets the name to use for the hi-lo sequence. /// </summary> /// <param name="property">The property.</param> /// <param name="name">The sequence name to use.</param> public static void SetHiLoSequenceName([NotNull] this IMutableProperty property, [CanBeNull] string name) => property.SetOrRemoveAnnotation( NpgsqlAnnotationNames.HiLoSequenceName, Check.NullButNotEmpty(name, nameof(name)));
/// <summary> /// Sets the index filter expression. /// </summary> /// <param name="index"> The index. </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 SetFilter([NotNull] this IConventionIndex index, [CanBeNull] string value, bool fromDataAnnotation = false) => index.SetOrRemoveAnnotation( RelationalAnnotationNames.Filter, Check.NullButNotEmpty(value, nameof(value)), fromDataAnnotation);
/// <summary> /// Sets the index filter expression. /// </summary> /// <param name="index"> The index. </param> /// <param name="value"> The value to set. </param> public static void SetFilter([NotNull] this IMutableIndex index, [CanBeNull] string value) => index.SetOrRemoveAnnotation( RelationalAnnotationNames.Filter, Check.NullButNotEmpty(value, nameof(value)));
/// <summary> /// Sets the name of the function to which the entity type is mapped. /// </summary> /// <param name="entityType"> The entity type to set the function name for. </param> /// <param name="name"> The name to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> /// <returns> The configured value. </returns> public static string SetFunctionName( [NotNull] this IConventionEntityType entityType, [CanBeNull] string name, bool fromDataAnnotation = false) => (string)entityType.SetAnnotation( RelationalAnnotationNames.ViewName, Check.NullButNotEmpty(name, nameof(name)), fromDataAnnotation)?.Value;
public static void SetSqlQuery([NotNull] this IMutableEntityType entityType, [CanBeNull] string?name) => entityType.SetAnnotation( RelationalAnnotationNames.SqlQuery, Check.NullButNotEmpty(name, nameof(name)));
/// <summary> /// Sets the key constraint name for this key. /// </summary> /// <param name="key"> The key. </param> /// <param name="name"> The value to set. </param> public static void SetName([NotNull] this IMutableKey key, [CanBeNull] string name) => key.SetOrRemoveAnnotation( RelationalAnnotationNames.Name, Check.NullButNotEmpty(name, nameof(name)));
/// <summary> /// Sets the name of the parent property to which the entity type is mapped. /// </summary> /// <param name="entityType"> The entity type to set the containing property name for. </param> /// <param name="name"> The name to set. </param> public static void SetContainingPropertyName([NotNull] this IMutableEntityType entityType, [CanBeNull] string name) => entityType.SetOrRemoveAnnotation( CosmosAnnotationNames.PropertyName, Check.NullButNotEmpty(name, nameof(name)));
/// <summary> /// Sets the key constraint name for this key. /// </summary> /// <param name="key"> The key. </param> /// <param name="name"> The value to set. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetName([NotNull] this IConventionKey key, [CanBeNull] string name, bool fromDataAnnotation = false) => key.SetOrRemoveAnnotation( RelationalAnnotationNames.Name, Check.NullButNotEmpty(name, nameof(name)), fromDataAnnotation);
/// <summary> /// Sets the database schema that contains the mapped table. /// </summary> /// <param name="entityType"> The entity type to set the 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 SetSchema( [NotNull] this IConventionEntityType entityType, [CanBeNull] string value, bool fromDataAnnotation = false) => entityType.SetOrRemoveAnnotation( RelationalAnnotationNames.Schema, Check.NullButNotEmpty(value, nameof(value)), fromDataAnnotation);
/// <summary> /// Sets the default container name. /// </summary> /// <param name="model"> The model. </param> /// <param name="name"> The name to set. </param> public static void SetDefaultContainer([NotNull] this IMutableModel model, [CanBeNull] string name) => model.SetOrRemoveAnnotation( CosmosAnnotationNames.ContainerName, Check.NullButNotEmpty(name, nameof(name)));
/// <summary> /// Sets the name of the table to which the entity type is mapped. /// </summary> /// <param name="entityType"> The entity type to set the table name for. </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 SetTableName( [NotNull] this IConventionEntityType entityType, [CanBeNull] string name, bool fromDataAnnotation = false) => entityType.SetOrRemoveAnnotation( RelationalAnnotationNames.TableName, Check.NullButNotEmpty(name, nameof(name)), fromDataAnnotation);
/// <summary> /// Sets the schema to use for the hi-lo sequence. /// </summary> /// <param name="property"> The property. </param> /// <param name="schema"> The schema to use. </param> public static void SetHiLoSequenceSchema([NotNull] this IMutableProperty property, [CanBeNull] string schema) => property.SetOrRemoveAnnotation( SqlServerAnnotationNames.HiLoSequenceSchema, Check.NullButNotEmpty(schema, nameof(schema)));
/// <summary> /// Sets the schema to use for the default hi-lo sequence. /// </summary> /// <param name="model"> The model. </param> /// <param name="value"> The value to set. </param> public static void SetSqlServerHiLoSequenceSchema([NotNull] this IMutableModel model, string value) { Check.NullButNotEmpty(value, nameof(value)); model.SetOrRemoveAnnotation(SqlServerAnnotationNames.HiLoSequenceSchema, value); }
/// <summary> /// Sets the schema to use for the hi-lo sequence. /// </summary> /// <param name="property"> The property. </param> /// <param name="schema"> The schema to use. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetHiLoSequenceSchema( [NotNull] this IConventionProperty property, [CanBeNull] string schema, bool fromDataAnnotation = false) => property.SetOrRemoveAnnotation( SqlServerAnnotationNames.HiLoSequenceSchema, Check.NullButNotEmpty(schema, nameof(schema)), fromDataAnnotation);
public static void SetCollation([NotNull] this IMutableModel model, [CanBeNull] string?value) => model.SetOrRemoveAnnotation( RelationalAnnotationNames.Collation, Check.NullButNotEmpty(value, nameof(value)));
/// <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> public static void SetDefaultSchema([NotNull] this IMutableModel model, [CanBeNull] string value) => model.SetOrRemoveAnnotation( RelationalAnnotationNames.DefaultSchema, Check.NullButNotEmpty(value, nameof(value)));
/// <summary> /// Sets the SQL expression that is used as the computed value for the column this property is mapped to. /// </summary> /// <param name="property"> The property. </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 SetComputedColumnSql( [NotNull] this IConventionProperty property, [CanBeNull] string value, bool fromDataAnnotation = false) => property.SetOrRemoveAnnotation( RelationalAnnotationNames.ComputedColumnSql, Check.NullButNotEmpty(value, nameof(value)), fromDataAnnotation);
/// <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> /// Sets the database schema that contains the mapped table. /// </summary> /// <param name="entityType"> The entity type to set the schema for. </param> /// <param name="value"> The value to set. </param> public static void SetSchema([NotNull] this IMutableEntityType entityType, [CanBeNull] string value) => entityType.SetAnnotation( RelationalAnnotationNames.Schema, Check.NullButNotEmpty(value, nameof(value)));
/// <summary> /// Sets the name of the container to which the entity type is mapped. /// </summary> /// <param name="entityType"> The entity type to set the container name for. </param> /// <param name="name"> The name to set. </param> public static void SetContainer(this IMutableEntityType entityType, string?name) => entityType.SetOrRemoveAnnotation( CosmosAnnotationNames.ContainerName, Check.NullButNotEmpty(name, nameof(name)));