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
This will get you nvarchar(max)
:
[StringLength(int.MaxValue)]
I don't think there's an attribute to force non-unicode (are you sure you want that?), so for varchar(max)
you need a tweak in the DbContext:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity().Property(x => x.MediaDesc).IsUnicode(false);
}