private void ValidateEmail(string email) { if (TextValidator.IsNullEmptyOrWhiteSpace(email)) { // Email empty or not provided. throw new ValidationException("Email can't be empty!"); } if (!TextValidator.HasEmailFormat(email)) { // Email must have the "*****@*****.**" format. throw new ValidationException("Email doesn't have a correct format ([email protected])!"); } }