Thursday, September 5, 2019

FluentValidation–Validating collections

On one of my projects we are using FluentValidation. After upgrading to FluentValidation 8 the way we had to validate our collections changed.

Before we were using this:

Now we had to use the RuleForEach method:

But what if you also want to validate if the collection itself is empty or not. This is still possible through RuleFor:

1 comment:

chandrasekhar said...

Nice Information
Yaaron Studios is one of the rapidly growing editing studios in Hyderabad. We are the best Video Editing services in Hyderabad. We provides best graphic works like logo reveals, corporate presentation Etc. And also we gives the best Outdoor/Indoor shoots and Ad Making services.
Best video editing services in Hyderabad,ameerpet
Best Graphic Designing services in Hyderabad,ameerpet­
Best Ad Making services in Hyderabad,ameerpet­