예제 #1
0
        public MembershipUser CreateUser(string username, string password)
        {
            var user = new User
                           {
                               UserName = username,
                               Email = string.Empty,
                               Password = BCrypt.HashPassword(password, BCrypt.GenerateSalt()),
                               CreatedDate = DateTime.Now,
                               IsActivated = false,
                               IsLockedOut = false,
                               LastLockedOutDate = DateTime.Now,
                               LastLoginDate = DateTime.Now
                           };

            _collection.Insert(user);
            return GetUser(username);
        }
예제 #2
0
        public MembershipUser CreateUserWithHashedPassword(string username, string hashedPassword)
        {
            var user = new User
                           {
                               UserName = username,
                               Email = string.Empty,
                               Password = hashedPassword,
                               CreatedDate = DateTime.Now,
                               IsActivated = false,
                               IsLockedOut = false,
                               LastLockedOutDate = DateTime.Now,
                               LastLoginDate = DateTime.Now
                           };

            _collection.Insert(user);
            return GetUser(username);
        }