Skip to content

Commit

Permalink
Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremySkinner committed Nov 27, 2019
1 parent 01e9be2 commit 35a147a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/_doc/validators/custom-validators.md
Expand Up @@ -111,7 +111,7 @@ context.AddFailure(new ValidationFailure("SomeOtherProperty", "The list must con
As before, this could be wrapped in an extension method to simplify the consuming code.

```csharp
public static IRuleBuilderOptions<T, IList<TElement>> ListMustContainFewerThan<T, TElement>(this IRuleBuilder<T, IList<TElement>> ruleBuilder, int num) {
public static IRuleBuilderInitial<T, IList<TElement>> ListMustContainFewerThan<T, TElement>(this IRuleBuilder<T, IList<TElement>> ruleBuilder, int num) {

return ruleBuilder.Custom((list, context) => {
if(list.Count > 10) {
Expand Down Expand Up @@ -197,4 +197,4 @@ public class PersonValidator : AbstractValidator<Person> {
RuleFor(person => person.Pets).ListMustContainFewerThan(10);
}
}
```
```

0 comments on commit 35a147a

Please sign in to comment.