public override ValidationException Validate(ValidatedObject credentials) { string username = credentials.Username; Regex regex = new Regex(@"[A-Za-z0-9]{3,24}"); if (!regex.IsMatch(username)) { return(new ValidationException("Login has to contain only latin letters and numbers and contain from 3 to 24 symbols", "login")); } if (this.hadnler != null) { return(this.hadnler.Validate(credentials)); } return(null); }
public override ValidationException Validate(ValidatedObject credentials) { string password = credentials.Password; Regex regex = new Regex(@"[A-Za-z0-9]{3,24}"); if (!regex.IsMatch(password)) { return(new ValidationException("Pasword has to contain only latin letters and numbers and contain from 3 to 24 symbols", "password")); } if (this.hadnler != null) { return(this.hadnler.Validate(credentials)); } return(null); }
public override ValidationException Validate(ValidatedObject credentials) { return(this.hadnler.Validate(credentials)); }
public abstract ValidationException Validate(ValidatedObject toValidate);