0

Looking at the examples, it seems like the expected pattern for validating an object Foo is to set all the validation rules in one AbstractValidator<Foo> class.

However, I think it can be good to separate business logic of different validations to separate AbstractValidator<Foo> classes, when the validations are more complex, especially when having to call external services for the validations.

I know I can implement different AbstractValidator<Foo> and call them from a list/array, but I am wondering, since this is a repeated pattern for me,
Is there any way to facilitate this?

I am looking for some class that get a list of AbstractValidator<Foo> and aggregate the results, optionally also running them in parallel.

Ido
  • 193
  • 2
  • 6
  • Possible duplicate of [FluentValidation multiple validators](https://stackoverflow.com/questions/13198471/fluentvalidation-multiple-validators) – Wim Ombelets Nov 16 '18 at 13:21
  • @WimOmbelets I saw this post, in my case I am trying to call different validations for `FOO` and not different validations of different properties of `FOO` – alex.dev Nov 16 '18 at 17:16
  • @alex.dev hi there. If you have a non-identical question to this one, please research it - maybe it's been answered here already - and if not then by all means post it. I'm sure there's a good chance you'll get it answered. – Wim Ombelets Nov 16 '18 at 23:09

0 Answers0