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

Created Unassigned: Collection Validation design request [7217]

$
0
0
Hi,

I have this object:

```
class Person
{
public List<string> Names { get; set; }
...
}
```
and would like to define validation rule that validates each name on empty string, and outputs following message:

Name '[IndexOfItem]' is empty -> Name '1' is empty, please populate.

With the current API around collection validation, it's difficult to get to the actual index of item in a collection.

Can you please support this in the api, or point me to an example as to how to do this with custom messages.

Thanks.
Stevo

Viewing all articles
Browse latest Browse all 1917

Trending Articles



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