Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: Do validation only for a single property

$
0
0
It's already possible to validate a single property like this:

varresult=validator.Validate(newPerson(),x=>x.Surname);

just make sure you have the FluentValidation namespace imported and this overload of Validate is available.

Note that you still have to instantiate the object being validated and set the property value yourself. FV will not do this for you.

Viewing all articles
Browse latest Browse all 1917

Trending Articles