不使用自动映射时,为nvarchar(max)列设置Fluent NHibernate默认映射长度

时间:2019-04-01 17:59:58

标签: fluent-nhibernate fluent-nhibernate-mapping

NHibernate在处理nvarchar(max)列方面有一个众所周知的问题:The length of the string value exceeds the length configured in the mapping/parameter

一种解决方案是在映射中显式指定长度:

Map(x => x.SomeLargeStringProperty).Length(int.MaxValue);

这可行,但是我不想为每个属性都声明它,而是将其设置为应用程序中所有nvarchar(max)映射的默认值。

如果我不使用自动映射功能,是否可以在FNH 2.0.3中做到这一点?

0 个答案:

没有答案
相关问题