1

我在堆栈溢出时看到了很多这些错误,并密切关注答案,但我真的在我的代码中看不到同样的问题。

尝试提交更改时出现以下异常:

{"Error dehydrating property value for MyModel.Field"}

除了和内部的例外:

{"The length of the string value exceeds the length configured in the mapping/parameter."}

我有一个看起来像这样的模型的映射覆盖:

 mapping.Map(x => x.Field).Length(10000); 

并且数据库中的列是nvarchar(MAX).

如果我在记事本++中检查该字段的值,它会说长度是 5355,并且堆栈跟踪没有提供更多信息。:(

我真的认为我已经涵盖了所有角度,为什么我仍然收到这个错误?

4

1 回答 1

2

这是关于 NHibernate 处理nvarchar(max).

我记得去年看到过这个:https ://stackoverflow.com/a/12711809/1517578

该 SO 答案具有指向 Fluent NHibernate 的解释和解决方法的链接。

于 2013-06-26T22:34:54.150 回答