I\'ve been searching around the web trying to figure out the right syntax to have Entity Framework Code First create my table with a column: varchar(max).
This is what I
[Column(TypeName = "varchar(MAX)")]
results in varchar(Max) in the database. If you have a custom convention setting strings MaxLength to 100,
modelBuilder
.Properties
you need to include the MaxLength attribute [Column(TypeName = "varchar(MAX)"), MaxLength]
. If you dont, you will get varchar(MAX) in the database but validation will throw for more that 100 characters