You can only check one property with Fluent Validation , and if so, how? I thought this discussion thread from January 2009 showed me how to do this using the following syntax:
validator.Validate(new Person(), x => x.Surname);
Unfortunately, this does not work in the current version of the library. Another thing that made me think that testing a single property might be possible is the following quote from Jeremy Skiners post :
“Finally, I added the ability to be able to execute some of the Validation Property Validators without having to validate the entire object. This means that now you can stop the default“ Value was required ”message from being added to ModelState.
However, I don't know if this means that it only supports validation of a single property or the fact that you can tell the validation library to stop validation after the first validation error.
Blegger
source share