NHibernate ignores length attribute
问题 After running SQL Profiler, I realized that NHibernate was mapping strings to nvarchar(4000). I fixed it by specifying type=AnsiString and length=... in the hbm file. It is now generating varchar(8000) statements, and it is ignoring the length. How come?! hbm file: <property name="EmailAddress" column="EMAIL_ADDRESS" type="AnsiString" length="120" /> database field: [EMAIL_ADDRESS] [varchar](120) NULL, TIA 回答1: Actually in previous versions of nhibernate the check against length was