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); }
public static bool UserEquals(UserWrapper user, IIdentity identity) { return String.Equals(user.Username, identity.Name, StringComparison.Ordinal); }