public void Update(UserDataObject user) { if (user.Id < 1) { throw new CustomException("Invalid user."); } ProfileValidator validator = new ProfileValidator(); if (!validator.IsValid(user)) { throw new FormException(validator.ErrorCodes); } userData.Update(user); }