开发者

xVal Date Validation with Nhibernate Validator

I am using xVal with NHibernate Validator and I have a hard time to validate the dates.

First, NHibernate does not have validation for Date/DateTime formatting (except Past and Future). Second, I tried xVal itself (not using NHibernate Validator) but still no chance.

I need to validate the date values (let's say in a text box), to make sure it's a valid date. For instance, 13/01/2010 or 11/31/2010 are not valid dates.

I have tried creating new rules for NHibernate Validator by extending a new class, but it needs to be declared in the xVal client side too. I don't like to overwrite the existing scripts, if possible. I also u开发者_StackOverflow中文版sed xval's [DataType(DataType.Date)] but it doesn't check if the date is valid!

Any suggestions?


After spending some time on this issue, here is the answer to my question: Custom Validation in xVal

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜