public Customer UpdateCustomer(Customer customer, int id) { var updateCustomer = _customerRepository.ReadCustomer(id); if (updateCustomer == null) { throw new Exception("Customer not found"); } customer.Psw = PswHash.HashPassword(customer.Psw, "salt"); return(_customerRepository.UpdateCustomer(customer, id)); }
public Customer CreateCustomer(Customer customer) { customer.Psw = PswHash.HashPassword(customer.Psw, "salt"); return(_customerRepository.CreateCustomer(customer)); }