EntLib 的多种验证方案 - .resx 样式?
目前,我在我的类中定义了一组 EntLib 验证规则。规则稍后将根据客户而变化。
我想做的是保留我的类,并简单地调用为特定客户端定义的不同规则集。
其功能类似于在 .resx 文件中存储国际化值,其中内容根据本地化参数而变化,但在这种情况下,预定义的规则将根据客户端而变化。
谢谢。
Currently I've got a set of EntLib validation rules defined in my classes. The rules will later change based on the client.
What I'd like to do is retain my classes, and simply call the different rule sets defined somewhere for the specific client.
The functionality of this is similar to storing internationalization values in a .resx file, where content changes based on localization parameters, but in this case, the pre-defined rules would change based on the client.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于那些想知道的人,给定 TerminalId 参数的以下规则集:
只需添加额外的规则集标识符即可解决问题。
...然后只需调用与登录客户端匹配的适当验证规则集。
啊EntLib。
For those who wonder, given the following ruleset for a TerminalId parameter:
Simply adding an additional rule set identifier would do the trick.
... then simply calling the appropriate validation rule set that matches the logged-in client.
Ah EntLib.