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

后端 未结 2 414
野趣味
野趣味 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:25

    This is to take advantage of auto parameterization. The following article explains the general concept as well as why specifically nvarchar(4000) is used.

    http://msdn.microsoft.com/en-us/magazine/ee236412.aspx

提交回复
热议问题