andrebaltieri / FluentValidator

Fluent Validator is a fluent way to use Notification Pattern with your entities
122 stars 40 forks source link

Add ability to have conditional rules in contracts #25

Open thiagolunardi opened 7 years ago

thiagolunardi commented 7 years ago

Example:

Contract .Required() .IfNotNull(x.LastName, contract => contract.MinLength(3)); Means: LastName is not required, but if informed, must have more 3 letters or more.