title: Validating a Login with Email or Phone and Password
body: <p>In my ASP.net core project I have a Login page with 2 property as</p>
  
  <pre><code>public class loginModel
  {
      public string EmailOrPhoneNumber { get; set; }
  
      [Required]
      [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
      [DataType(DataType.Password)]
      [Display(Name = "Password")]
      public string Password { get; set; }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ZOsYo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZOsYo.jpg" alt="enter image description here"></a></p>
  
  <p>I just want make login page which can login with email or phonenumber but I don't know how validate this property (validate email and phoneNumber)</p>
  
  <p>Any suggestion?</p>