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

Edited Issue: Problem with a Must overload. [7131]

$
0
0
I'm having trouble using the following overload:
```
Must<T, TProperty>(Func<TProperty, bool> predicate)
```

The presence of the generic T in the method definition prevents concise usage such as:
```
RuleFor(x => x.Title).Must(s => !string.IsNullOrWhiteSpace(s) || s.Length == 0);
```
Instead I must type:
```
RuleFor(x => x.Title).Must((string s) => !string.IsNullOrWhiteSpace(s) || s.Length == 0);
```

Viewing all articles
Browse latest Browse all 1917

Trending Articles



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