How to ignore validation data annotations if empty
mohammad68a opened this issue · 1 comments
mohammad68a commented
I have an issue when i define validation like this
[Display(Name = "شماره همراه سرپرست")]
[ValidIranianMobileNumber(ErrorMessage = "{0} وارد شده صحیح نمی باشد!")]
public string SupervisorPhoneNumber { get; set; }
this property is not required and I want when user entered anything, this validator start to work and otherwise ignore to check.