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

后端 未结 1 422
北恋
北恋 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().Configure(x => x.HasColumnType("VARCHAR"));
    

    0 讨论(0)
提交回复
热议问题