Skip to content

Execute Predicate for each element in collection #106

Description

@3DExtended

Is your feature request related to a problem? Please describe.
I am using this package for validating complex data structures and often need to validate lists or other collection types. I want to be able to validate list items without having to write a new validator specifically for each case in which the item occurs in a list.

For example, suppose there is a class with a list of persons, and I want to ensure that every person in the list is younger than 21 years. I don't want to write a separate validator for each list that contains a person as this would be overkill for such a simple validation.

Describe the solution you'd like
I would like to be able to validate list items without having to create an additional validator, similar to the functionality provided by FluentValidation.

Describe alternatives you've considered
One alternative is to write validators for each collection in my data structure, but this would create unnecessary overhead.

Additional context
I realize that the example above may not be the best, but it should help illustrate my issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions