turnsweerse
New Member
I am using \[code\]ASP.NET 4\[/code\] and \[code\]Fluent Validation\[/code\].I am trying to setup a rule that checks if my user name starts with "adm".I have the following, giving me errors. I tried to follow the online sample but it is not working:\[code\]RuleFor(x => x.UserName) .NotNull() .WithMessage("Required") .Must(x => x.UserName.StartsWith("adm")) .WithMessage("Must start with ADM");\[/code\]I don't think I am doing it correctly?I've event tried:\[code\].Must(x => x.UserName.Substring(0, 3) == "adm")\[/code\]Error for both:\[code\]Delegate 'System.Func<MyProject.ViewModels.LogOnViewModel,string,bool>' does not take 1 arguments\[/code\]