Castle ValidateEmail 属性在加号上失败
我在我的模型上使用 Castle Validators。 我的 EmailAddress 属性定义如下:
[ValidateEmail]
public string EmailAddress { get; set; }
问题是 ValidateEmail 属性使用的正则表达式 (?) 不正确。 例如,如果我输入类似 [email protected] 的电子邮件地址,它验证正确,但如果我输入像 [email protected] 这样的地址,它说它无效。
我意识到我可以将 ValidateRegExp 属性与我自己的正则表达式一起使用,但如果可能的话,我更愿意使用系统中已内置的内容。
那么有什么方法可以“修复”ValidateEmail 属性吗?
I am using Castle Validators on my model. I have an EmailAddress property defined like so:
[ValidateEmail]
public string EmailAddress { get; set; }
The problem is that the regex (?) that the ValidateEmail attribute uses is incorrect. For instance, if I put in an email address like [email protected], it validates correctly, but if I put in an address like [email protected], it says it is not valid.
I realize that I can just use the ValidateRegExp attribute with my own regex, but if possible, I'd prefer to use what's already built in to the system.
So is there some way to "fix" the ValidateEmail attribute?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请从构建服务器获取最新版本,这是几周前修复。
Please get the latest build from the build server, this was fixed a couple of weeks ago.
鉴于 Castle 项目是开源的,请获取源代码并自行修复。 然后将补丁提交回项目。
项目维护者会欣赏它(通常是;YMMV)并且项目会变得更强大。
Given that the Castle project is open-source, grab the source and fix it yourself. Then submit the patch back to the project.
The project maintainers will appreciate it (normally; YMMV) and the project gets stronger.