Example #1
0
 public UserModel Insert(NewUserRequestModel newUser)
 {
     string message;
     if (NewUserRequestModel.Validate(newUser, out message))
     {
         User user = new User();
         user.Username = newUser.Username;
         user.Salt = Hasher.GetSalt();
         user.Password = Hasher.Hash(newUser.Password, user.Salt);
         _userRepo.Insert(user);
         return Mapper.Map<User, UserModel>(user);
     }
     else
     {
         return null;
     }
 }
Example #2
0
 partial void UpdateUser(User instance);
Example #3
0
 partial void DeleteUser(User instance);
Example #4
0
 partial void InsertUser(User instance);