Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RuleFor(x => x.Phone)
- .Must(x => x == null || x?.CountryCode?.Code?.Length <= 16)
- .Must(x => x == null || Regex.IsMatch(x?.CountryCode?.Code, @"^+[1-9]{1,3}$|null"))
- .OverridePropertyName("PhoneCode")
- .WithMessage("String does not match pattern ^\+[1-9]{1,3}$");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement