-
Notifications
You must be signed in to change notification settings - Fork 3
FluentMigrator
Jay Harris edited this page Apr 21, 2016
·
2 revisions
FluentMigrator utilities and classes for Cobweb, a base-class utility library for .NET
To install the package, run the following from the Package Manager Console:
Install-Package Cobweb.Data.FluentMigrator
The library includes several extension methods to extend FluentMigrator. When creating or modifying a column, these extensions allow all schema, properties, and options for that column to be grouped and contained within the Column functions.
WithColumn(string columnName, Func columnOptions)
Example
Create.Table("TableName")
.WithColumn("ColumnName", col => col.AsInt32().NotNullable())
.WithColumn("AnotherName", col => col.AsBoolean());
AddColumn(string columnName, Func columnOptions)
AlterColumn(string columnName, Func columnOptions)
Example
Alter.Table("TableName")
.AddColumn("ColumnName", col => col.AsInt32().NotNullable())
.AlterColumn("AnotherName", col => col.AsBoolean());