How to call ValidationAttributes manually? (DataAnnotations and ModelState)
问题 We have a need within some of our logic to iterate through the properties of a model to auto-bind properties and want to extend the functionality to include the new dataannotations in C# 4.0. At the moment, I basically iterate over each property loading in all ValidationAttribute instances and attempting to validate using the Validate/IsValid function, but this doesn't seem to be working for me. As an example I have a model such as: public class HobbyModel { [Required(AllowEmptyStrings =