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);
```
The class being validated (T) is not used anywhere in the predicate and can be removed from the method signature.
Comments: I'm not able to reproduce this problem. The type inference takes care of this so there is no need to explicitly specify the type. The following compiles just fine using FluentValidation 3.4.6: ``` public class Demo { public string Title { get; set; } } public class DemoValidator : AbstractValidator<Demo> { public DemoValidator() { RuleFor(x => x.Title).Must(s => !string.IsNullOrWhiteSpace(s) || s.Length == 0); } } ``` If you're running the latest version, please put together a small sample that reproduces the problem. Thanks.
```
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);
```
The class being validated (T) is not used anywhere in the predicate and can be removed from the method signature.
Comments: I'm not able to reproduce this problem. The type inference takes care of this so there is no need to explicitly specify the type. The following compiles just fine using FluentValidation 3.4.6: ``` public class Demo { public string Title { get; set; } } public class DemoValidator : AbstractValidator<Demo> { public DemoValidator() { RuleFor(x => x.Title).Must(s => !string.IsNullOrWhiteSpace(s) || s.Length == 0); } } ``` If you're running the latest version, please put together a small sample that reproduces the problem. Thanks.