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

New Post: Get index in a collection as nested property

$
0
0

If you're using a collection validator (using SetCollectionValidator) then the index is automatically included in the property name. However, if you need to perform the validation at the school level then you'd need to write a custom property validator to do this. Take a look at the code for the CollectionValidatorAdaptor (https://github.com/JeremySkinner/FluentValidation/blob/master/src/FluentValidation/Validators/ChildCollectionValidatorAdaptor.cs) - this should give you a starting point for writing a custom property validator that is aware of its place within the collection.

Hope this helps

Jeremy 


Viewing all articles
Browse latest Browse all 1917

Latest Images

Trending Articles



Latest Images

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