automapping

Override for fluent NHibernate for long text strings nvarchar(MAX) not nvarchar(255)

半腔热情 提交于 2019-11-27 02:02:30
问题 When ever you set a string value in fluent NHibernate it alwasy sets the DB vales to Nvarchar(255), I need to store quite a lot of long string which are based on user inputs and 255 is impractical. Just to add this is an issue with the automapper as I am using fluent NHibernate to build the database. 回答1: Adding this convention will set the default length for string properties to 10000. As others have noted, this will be a nvarchar(max) column. public class StringColumnLengthConvention :