如果配置了 ValidatorMode.UseExternal,则 ValidatorEngine.Validate 返回 null(无错误)
我正在将 nhibernate 验证器集成到我的应用程序中,并且属性一切正常 但是一旦我创建 *.nhv.xml 文件并将我的验证规则移到那里(作为嵌入资源)
ValidatorEngine.Validate(entity)
returns wrong (actually nothing and my InvalidValue[]
collection is empty我同意任何评论/建议
i am integrating nhibernate validator into my application and and everything is fine with attributes
but as soon as I create *.nhv.xml files and move my validation rules there (as embedded resource)
ValidatorEngine.Validate(entity)
returns wrong (actually nothing and my InvalidValue[]
collection is empty
I appropriate any comment/advise
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是由于 nhibernate 验证器的配置部分
首先是
should get assigned to
then
we have to call the current engine's
not a new instance
of
ValidatorEngine
so the full configuration section may look like this:
The problem was because of configuration part of the nhibernate validator
first the
should get assigned to
then
we have to call the current engine's
not a new instance
of
ValidatorEngine
so the full configuration section may look like this: