Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
现在我使用基于自定义 DataAnnotation 属性和DataAnnotationsModelValidatorProvider. 流利的验证是否更流利?:) 它可以完全取代 DataAnnotations 吗?
DataAnnotationsModelValidatorProvider
可悲的答案是否定的。DataAnnotations 中有几个验证规则当前未在 FluentValidation 中强制执行。也就是说,在服务器端实现相同的验证是一项容易的任务,但在客户端也必须实现它们是一件痛苦的事情。
我知道他们正在 - 并且一直在 - 开发即将推出的 FluentValidation 新版本,它增加了对更多验证的支持,包括自定义验证(客户端)