Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Issue: MinLength validator fails on empty string [375]

$
0
0
[MinLength(6)]
public string Foo { get; set; }

If the value for this field is an empty string the web api model validator adds an error: "Foo must be a string or array type with a minimum length of 6"

Shouldn't an empty string be treated the same as null?

If I wanted a validation error for empty string I would add a [Required] validator.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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