コード例 #1
0
 public dynamic Register(UserRegisterdViewModel userRegisterd)
 {
     return(this.ExecuteInMonitoring(() =>
     {
         return customerLogic.CreateCustomer(userRegisterd).ToViewModel <CustomerViewModel>();
     }));
 }
コード例 #2
0
ファイル: CustomerLogic.cs プロジェクト: dinhphu951998/NowVN
        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);
        }