Exemple #1
0
 private static bool ValidateUser(UserDto user, List <ValidationResult> validationResults)
 {
     if (_userRegistrationService.UserNameExist(user.UserName))
     {
         validationResults.Add(new ValidationResult("This username already exists."));
         return(false);
     }
     if (_userRegistrationService.EmailExist(user.EmailAddress))
     {
         validationResults.Add(new ValidationResult("This email address already registered."));
         return(false);
     }
     return(true);
 }