/// <summary>
 /// Выбирает таблицу с именем на основе типа <typeparamref name="TTable"/> или её столбцы.
 /// </summary>
 /// <returns>См. <see cref="IAlterExpressionRoot.Table(string)"/>.</returns>
 /// <remarks>В качестве имени таблицы используется значение атрибута <see cref="TableAttribute"/> или имя типа в единственном числе.</remarks>
 public static IAlterTableAddColumnOrAlterColumnOrSchemaOrDescriptionSyntax Table <TTable>(this IAlterExpressionRoot alter)
 {
     return(alter.Table(GetTableName <TTable>()));
 }
Exemple #2
0
 public static IAlterTableAddColumnOrAlterColumnSyntax AppTable(this IAlterExpressionRoot alterExpressionRoot, string tableName)
 {
     return(alterExpressionRoot.Table(tableName).InSchema(SchemaExtensions.Name));
 }
Exemple #3
0
        /// <summary>
        /// Alter the table or its columns/options<br/>
        /// If <paramref name="migration"/>.SchemaPrefix have a value, the Syntax-OldName will be computed to {<paramref name="migration"/>.SchemaPrefix}{<paramref name="tableName"/>}<br/>
        /// If NOT, the Syntax-OldName will be the same as {<paramref name="tableName"/>}
        /// </summary>
        /// <param name="root">Expression root to extend</param>
        /// <param name="tableName">
        /// The table name to alter<br/>
        /// See summary-section how this parameter is used
        /// </param>
        /// <param name="migration"><see cref="IMigrationModel"/></param>
        /// <returns>The interface for the modifications - <see cref="IAlterTableAddColumnOrAlterColumnOrSchemaOrDescriptionSyntax"/></returns>
        public static IAlterTableAddColumnOrAlterColumnOrSchemaOrDescriptionSyntax Table(this IAlterExpressionRoot root, string tableName, IMigrationModel migration)
        {
            var syntax = root.Table(migration.GetPrefixedName(tableName));

            syntax.InSchema(migration.SchemaName);
            return(syntax);
        }
Exemple #4
0
        public static IAlterTableAddColumnOrAlterColumnOrSchemaOrDescriptionSyntax TableForEntity <TEntity>(this IAlterExpressionRoot root)
            where TEntity : class, IEntity
        {
            var tableName = TableName.ForEntity <TEntity>();

            return(root.Table(tableName));
        }