Ejemplo n.º 1
0
 public static IAddedForeignKey AddDefaultForeignKeyTo(this IExistingTable table, string foreignTable)
 {
     return(table.AddForeignKeyTo(foreignTable).Through(ForeginKeyColumnTo(foreignTable), "Id"));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets an foreign key constraint by the name of its referenced table.
 /// </summary>
 public static IForeignKey ForeignKeyTo(this IExistingTable table, string referencedTableName)
 {
     return(table.ForeignKeys[DefaultObjectNameProvider.GetForeignKeyConstraintName(table.TableName, referencedTableName, null)]);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the primary key constraint of the table with the default name.
 /// </summary>
 public static IExistingPrimaryKey PrimaryKey(this IExistingTable table)
 {
     return(table.PrimaryKey(DefaultObjectNameProvider.GetPrimaryKeyConstraintName(table.TableName, null)));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets an unique constraint by the name of its first column.
 /// </summary>
 public static IUniqueConstraint UniqueConstraintOf(this IExistingTable table, string firstColumnName)
 {
     return(table.UniqueConstraints[DefaultObjectNameProvider.GetUniqueConstraintName(table.TableName, firstColumnName, null)]);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Adds an unique constraint to the table with the default name.
 /// </summary>
 public static IAddedUniqueConstraint AddUniqueConstraint(this IExistingTable table)
 {
     return(table.AddUniqueConstraint(null));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Adds a foreign key constraint to another table within the same schema with a default foreign key name.
 /// </summary>
 public static IAddedForeignKey AddForeignKeyTo(this IExistingTable table, string referencedTableName)
 {
     return(table.AddForeignKeyTo(referencedTableName, null));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Adds an index to the table.
 /// </summary>
 public static IAddedIndex AddIndex(this IExistingTable table)
 {
     return(table.AddIndex(null));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Adds a primary key constraint to the table with the default name.
 /// </summary>
 public static IAddedPrimaryKey AddPrimaryKey(this IExistingTable table)
 {
     return(table.AddPrimaryKey(null));
 }