public User Update(string email, User userToUpdate) { userToUpdate.ValidateForUpdate(); User user = Users.GetAll().Find(u => u.Email.Equals(email)); user.Password = userToUpdate.Password; user.PasswordConfirmation = userToUpdate.PasswordConfirmation; user.Name = userToUpdate.Name; user.BornDate = userToUpdate.BornDate; user.Phone = userToUpdate.Phone; user.EncryptPassword(); return(Users.Update(user)); }
public User SignUp(User user) { user.Validate(); user.EncryptPassword(); return(Users.Add(user)); }