public void CreateUser(CreateUser viewModel) { var user = new User { Name = viewModel.UserName, Password = EncryptPassword(viewModel.Password) }; repository.Add(user); SaveUser(); }
public void UpdateUser(User model) { var user = GetUserById(model.Id); user.Password = EncryptPassword(model.Password); repository.Update(user); SaveUser(); }