Skip to content

Commit

Permalink
Updated Custom Validator example
Browse files Browse the repository at this point in the history
Updated Custom Validator example to avoid confusion.
  • Loading branch information
utsxumiao authored and JeremySkinner committed Feb 19, 2020
1 parent 1c38b89 commit f2b1b6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/custom-validators.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To ensure our list property contains fewer than 10 items, we could do this:
```csharp
public class PersonValidator : AbstractValidator<Person> {
public PersonValidator() {
RuleFor(x => x.Pets).Must(list => list.Count <= 10)
RuleFor(x => x.Pets).Must(list => list.Count < 10)
.WithMessage("The list must contain fewer than 10 items");
}
}
Expand Down

0 comments on commit f2b1b6f

Please sign in to comment.