public dynamic Register(UserRegisterdViewModel userRegisterd) { return(this.ExecuteInMonitoring(() => { return customerLogic.CreateCustomer(userRegisterd).ToViewModel <CustomerViewModel>(); })); }
public Customer CreateCustomer(UserRegisterdViewModel userRegisterd) { Customer customer = userRegisterd.ToEntity <Customer>(); byte[] passwordSalt, passwordHash; PasswordManipulation.CreatePasswordHash(userRegisterd.Password, out passwordHash, out passwordSalt); customer.PasswordHash = passwordHash; customer.PasswordSalt = passwordSalt; customer.Id = Guid.NewGuid().ToString(); this.Add(customer); return(customer); }