Hi,

I'm developping a plugin in Nop 4.40.4. When I submit a form, I want to verify that the new database record doesn't already exist and that the unique field isn't empty. So here is my validators


RuleFor(template => template.TemplateName)
.NotEmpty().WithMessage("Error message");

RuleFor(template => template.TemplateName).Must((template, _) => !templateService.DoesTemplateExist(template.TemplateName).Result)
.WithMessage("Error message');


The first validator works well, but the second don't. At first, I tried merging both together in one rule, didn't work. I tried to switch the validators' order, nothing change. I also tried to use the Custom validator, but it didn't work either. I also tried
Must((_,_) => true)
and
Must((_,_) => false)
at the same time but neither send me a message back.

Is there a reason why the must don't work when validating a form? What should I use (that works if possible) instead of the Must?