EF4 CTP5 - HasColumnType not working

I want to override the standard nvarchar (4000) for one of my string columns into a text data type in SQL Express. I am using this code.

modelBuilder.Entity<Accommodation>()
               .Property(p => p.Information)
               .HasColumnType("text");

But the column type remains as nvarchar?

I also asked here http://social.msdn.microsoft.com/Forums/en/adonetefx/thread/a1d84ea9-2f8e-42f0-bb83-ac9f68805d6d?prof=required

+3
source share
1 answer

Ahh I just figured it out, adding that smooth matching was not enough to make the table omit the AndCreate again, even if I had DropCreateDatabaseIfModelChanges set.

I had to force it to update the table manually.

+1
source

Source: https://habr.com/ru/post/1788158/


All Articles