Let's say I have an object, MyEntity, and a Validator for it, MyEntityValidator : AbstractValidator<MyEntity>. Now, I have incoming a List<MyEntity>, and I want to validate all the MyEntitys in this list. What is the correct way of doing this validation? I obviously can't use MyEntityValidator, since it expects a MyEntity and not a List<MyEntity>, but creating MyEntityListValidator : AbstractValidator<IEnumerable<MyEntity>> seems like overkill (and I'm not sure how that would work anyway). Creating a new class, ListOfMyEntities, also seems like overkill.
↧