First you have to use nullable integer type for collection item, otherwise empty textboxes would be bound to zero value, what makes impossible to distinguish empty textboxes and filled with zeros.
public List<int?> TransDrops { get; set; }
Next, use predicate validator (Must rule):
RuleFor(model => model.TransDrops)
.Must(collection => collection == null || collection.All(item => item.HasValue))
.WithMessage("Please fill all items");
If you need to prevent empty collection being successfully validated, just add NotEmpty()
rule before predicate validator: it checks that any IEnumerable
not null
, and have at least 1 item.