I noticed a very strange problem when using the Fluent Validation proposal Must.
Say I have a model like this:
public class PhoneDetail
{
public int PrefixId { get; set; }
public string Digits { get; set; }
}
And here is the validator:
public PhoneDetailValidator()
{
this.RuleFor(phone => phone.Digits)
.Must(x => x == null);
}
What type do x you think ? String? Yes you are right.

But what is it?

He changed his type from Stringto PhoneDetail. I am using Visual Studio 2012 .
Is this a mistake or something else?
Update:
In addition, it is worth saying that in the first case it compiles just fine. But in the second case, a compiler error occurs:
> Delegate 'System.Func<SportsStore.WebUI.Models.PhoneDetail,string,bool>'
> does not take 1 arguments
source
share