Hi dear.
I want to add extra RuleFor for Phone Field in RegisterModel in custom plugin.so I create a plugin and extend RegisterValidator The following form:
public partial class RegisterValidator : AbstractValidator<RegisterModel>
{
public RegisterValidator(ILocalizationService localizationService)
{
RuleFor(x => x.Phone)
.Matches(
@"^(0|\+98)?([ ]|,|-|[()]){0,2}9[1|2|3|4]([ ]|,|-|[()]){0,2}(?:[0-9]([ ]|,|-|[()]){0,2}){8}$")
.WithMessage(localizationService.GetResource("Account.Fields.Phone.InvalidMobileNumber"));
}
}
but this not work.
Generally, how can change RegisterValidator in custom plugin?!
Please advice me,if possible.
[Best Regards]