Beispiel #1
0
        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));
        }
Beispiel #2
0
        public Customer CreateCustomer(Customer customer)

        {
            customer.Psw = PswHash.HashPassword(customer.Psw, "salt");
            return(_customerRepository.CreateCustomer(customer));
        }