Entity Framework 6 code first: setting unicode to false for string properties

后端 未结 1 421
北恋
北恋 2021-02-02 17:33

In my model i have some entities decorated with StringLength attribute:

[StringLength(128)]    
public string FirstName { get; set; }

Also i ha

相关标签:
1条回答
  • 2021-02-02 17:57

    Seems to be a bug (or omission) in the new PropertyConventionConfiguration API. The following configuration does work, so it can serve as a work-around:

    modelBuilder.Properties<string>().Configure(x => x.HasColumnType("VARCHAR"));
    
    0 讨论(0)
提交回复
热议问题