Validation Rules and Data Annotations

Validation Rules and Data Annotations

Old forum URL: forums.lhotka.net/forums/t/8464.aspx


Regent posted on Wednesday, February 03, 2010

Hi Rocky,

Currently CLSA support only per-property validation attributes. But DataAnnotation.ValidationAttribute can be applied to the class itself when multiple fields are to be used for validation (like PropertiesMustMatch attribute from the MVC2).

Are you planning to add support for them?

Thanks

RockfordLhotka replied on Wednesday, February 03, 2010

That is a good point. In .NET 3.5 SP1 that wasn't possible, and it hadn't occurred to me that the new 4.0 ValidationAttribute model (which was really introduced in SL3) would work at a class level. But of course it would.

So the answer is yes  :)

Copyright (c) Marimer LLC