Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何配置实体框架模型以生成具有类型列CHAR(X)而不是VARCHAR(X)or的表NVARCHAR(X)?
CHAR(X)
VARCHAR(X)
NVARCHAR(X)
CHAR/NCHAR
VARCHAR/NVARCHAR
使用除法IsFixedLength之外的方法HasMaxLength。
IsFixedLength
HasMaxLength
builder.Property(x => x.MyField).HasMaxLength(10).IsFixedLength();
CHAR/VARCHAR
NCHAR/NVARCHAR
你需要打电话IsUnicode(false)
IsUnicode(false)
builder.Property(x => x.MyField).IsUnicode(false);