Hello,
After reading Jeremy's blog about FV3 Collection Validation I added the following rule:
RuleFor(x => x.Files).SetCollectionValidator(new FileValidator()).WithMessage("ERROR");
Where x.Files is of type HttpPostedFilleBase[] And FileValidator is:
public class FileValidator : AbstractValidator<HttpPostedFileBase>
public FileValidator() {
RuleFor(x => x).NotNull().WithMessage("The file is required");
}
}
When x.Files has 3 items but all them null I do not get any error on the ModelState.
Why is that?
Thank You,
Miguel
Thank You,
Miguel