views:

42

answers:

2

Using FluentMigrator (http://code.google.com/p/fluentmigrator/), the default creation of a Column using .AsString() results in an nvarchar(255). Is there a simple way (before I modify the FluentMigrator code) to create a column of type nvarchar(MAX)?

+1  A: 

OK, I found it. Basically, use .AsString(Int32.MaxValue). Pity there's not a .AsMaxString() method, but I guess it's easy enough to put in...

Darren Oster
A: 

You could create an extension method to wrap .AsString(Int32.MaxValue) within .AsMaxString()

e.g.

internal static class MigratorExtensions
{
    public static ICreateTableColumnOptionOrWithColumnSyntax AsMaxString(this ICreateTableColumnAsTypeSyntax createTableColumnAsTypeSyntax)
    {
        return createTableColumnAsTypeSyntax.AsString(int.MaxValue);
    }
}
Jon Cahill