public PortalUser AuthenticateUser(string email, Password password)
 {
     PortalUser user;
     try
     {
         user = userRepository.LoadUser(email);
     }
     catch (Exception)
     {
         throw new UserNotAuthorizedException();
     }
     if (!password.Equals(user.Password))
         throw new UserNotAuthorizedException();
     return user;
 }
 public bool Equals(Password other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.EncryptedPassword, EncryptedPassword);
 }