更新时间:2023-02-01 10:10:21
您需要注册异常转换器.
You need to register the exception converter.
在代码中:
configuration.SetProperty(
Environment.SqlExceptionConverter,
typeof(SqlExceptionConverter).AssemblyQualifiedName);
在配置文件中:
<property name="sql_exception_converter">
Name.Space.SqlExceptionConverter, MyAssembly
</property>
直到现在我还没有尝试过,只是在代码中查找了一下.希望它能工作,我也会需要它:-)
I didn't try this until now, just looked in up in the code. Hope it works, I'll need it too :-)