开发者

EF4 CTP5 - HasColumnType not working

开发者 https://www.devze.com 2023-02-07 14:09 出处:网络
I want to override the default nvarchar(4000) for one of my string columns to a text data type in SQL Express. I use 开发者_如何转开发this code.

I want to override the default nvarchar(4000) for one of my string columns to a text data type in SQL Express. I use 开发者_如何转开发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


Ahh I just figured it out, adding the fluent mapping was not sufficient to force the table to dropAndCreate itself again even though I had DropCreateDatabaseIfModelChanges set.

I had to force it to update the table manually.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号