Why does code first/EF use 'nvarchar(4000)' for strings in the raw SQL command?

后端 未结 2 413
野趣味
野趣味 2020-12-19 06:43

Essentially I have a table with zip codes in it. The zipcode field is defined as \'char(5)\'. I\'m using code first, so I\'ve put these attributes on my ZipCode property:

2条回答
  •  难免孤独
    2020-12-19 07:13

    Have you tried using the MaxLength attribute? This article gives a decent summary of how the various data annotation attributes are interpreted by EF.

提交回复
热议问题