I have a number of domain classes with DataAnnotations applied to them, and I require to validate them in my service layer.
I am u开发者_JS百科sing WCF, .NET 3.5
If i was using .NET 4 I would have access to the Validator as follows
Validator.ValidateObject(@event.Entity, new ValidationContext(@event.Entity, null, null), true);
is there a framework in 3.5 which allows me to do the same?
I have used http://annotationscontrib.codeplex.com/ with 3.5 be it with MVC.
If it doesn't work out of the box you can check the source code to see how the attributes are parsed.
精彩评论