It would be useful to be able to add an error for a collection property if any of the items fail validation.
Fantasy code below:
Has anybody solved this issue with a simple extension? Is this worth considering as a core library feature?
Fantasy code below:
RuleFor(x => x.Guests)
.SetCollectionValidator(x => new GuestValidator(dataSource, x.Guests))
.AllItemsValid()
.WithMessage("Please select a pickup point for each guest");
If the first guest element were invalid, the validation result would include errors on the Guests property and also on Guests[0]. Has anybody solved this issue with a simple extension? Is this worth considering as a core library feature?