コード例 #1
0
        public MembershipCreateStatus CreateUser(string userName, string fullName, string password, string email, UserRole role)
        {
            ValidationUtil.ValidateRequiredStringValue(userName, "userName");
            ValidationUtil.ValidateRequiredStringValue(password, "password");
            ValidationUtil.ValidateRequiredStringValue(email, "email");

            var newUser = new User
                               {
                                   UserId = userName,
                                   FullName = fullName,
                                   Password = HashToBase64(password),
                                   PasswordIsHashed = true,
                                   Role = role,
                                   EmailAddress = email
                               };

            bool success = _userRepository.CreateOrUpdateUser(newUser);

            return success ? MembershipCreateStatus.Success : MembershipCreateStatus.UserRejected;
        }
コード例 #2
0
 public void CreateUser(User user)
 {
     CreateUser(user.UserId, user.FullName, user.Password, user.EmailAddress, user.Role);
 }
コード例 #3
0
ファイル: UserRepository.cs プロジェクト: harpreet/TinyBlog
        public bool CreateOrUpdateUser(User user)
        {
            CUDQuery query = session => session.SaveOrUpdate(user);

            return QueryExecutor.UpdateDelete(query);
        }