Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: Collection validation is not letting WithMessage to show the custom message

$
0
0

Hi

I'm afraid this isn't supported - when using child validators the error messages are always generated by the child validator, not the top level validator.  You'd need to set the messages inside the child validator using WIthMessage on the Name and Age rules. This might be changed in a future release, but for now I'm afraid you can't use WithMessage and SetCollectionValidator together.

Jeremy


Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>