示例#1
0
        internal bool TrySetPassword(UserWrapper user, Expression<Func<string>> valueSelector, ErrorBuilder errors)
        {
            string newPassword = valueSelector.Compile().Invoke();

             string passErr = ValidatePassword(newPassword);

             if (errors.Assert(passErr == null, passErr, valueSelector)) {

            string currentPassword = user.Password;

            user.Password = ProcessPasswordForStorage(newPassword);

            if (errors.ValidProperty(() => user.Password))
               return true;

            user.Password = currentPassword;
             }

             return false;
        }
 public void UpdateUser(UserWrapper user)
 {
     this.repo.UpdateUser(user.WrappedUser);
 }
示例#3
0
 public static bool UserEquals(UserWrapper user, IIdentity identity)
 {
     return String.Equals(user.Username, identity.Name, StringComparison.Ordinal);
 }