entity framework 4 and sql server datatype (nchar vs char)
i'm developing a web app application and I'm using EntityFramework ObjectModel to design my Model layer.
The matter is that I've some string fields (like 'CodiceFiscale', an unique identifier for people in Italy) that should be 16 char long. The designer let me make it fixed length, max length = 16, but it means the field will be nchar(16) in sql server.
Is there any chance to set that field as char (开发者_运维问答I'd like to avoid field padding at the end)
thx in advance
Just use the MaxLength = 16, FixedLength = false
settings in your model:
That ought to result in a NVARCHAR(16)
column, and that's what you're looking for.
精彩评论