コード例 #1
0
        public string Create(UserWrongPasswordPoco poco)
        {
            UserWrongPassword entity = _mapper.Map <UserWrongPassword>(poco);

            _userWrongPassword.InsertOne(entity);
            return(entity.Id);
        }
コード例 #2
0
        public string Create(UserWrongPasswordPoco poco)
        {
            UserWrongPassword entity = _mapper.Map <UserWrongPassword>(poco);

            _context.SaveAsync(entity);

            return(entity.Id);
        }
コード例 #3
0
        public UserWrongPasswordPoco Find(string userId)
        {
            UserWrongPassword entity = _context.LoadAsync <UserWrongPassword>(userId).Result;

            if (entity == null)
            {
                return(null);
            }
            return(_mapper.Map <UserWrongPasswordPoco>(entity));
        }
コード例 #4
0
        public UserWrongPasswordPoco Find(string userId)
        {
            UserWrongPassword entity = _userWrongPassword.Find(e => e.Id == userId).SingleOrDefault();

            if (entity == null)
            {
                return(null);
            }
            return(_mapper.Map <UserWrongPasswordPoco>(entity));
        }
コード例 #5
0
        public void IncreaseFailedCount(string userId)
        {
            UserWrongPassword entity = _context.LoadAsync <UserWrongPassword>(userId).Result;

            if (entity == null)
            {
                entity = new UserWrongPassword
                {
                    Id          = userId,
                    FailedCount = 1
                };
                _context.SaveAsync(entity);
            }
            else
            {
                entity.FailedCount++;
                _context.SaveAsync(entity);
            }
        }
コード例 #6
0
        public void IncreaseFailedCount(string userId)
        {
            UserWrongPassword entity = _userWrongPassword.Find(e => e.Id == userId).SingleOrDefault();

            if (entity == null)
            {
                entity = new UserWrongPassword
                {
                    Id          = userId,
                    FailedCount = 1
                };
                _userWrongPassword.InsertOne(entity);
            }
            else
            {
                entity.FailedCount++;
                _userWrongPassword.ReplaceOne(e => e.Id == entity.Id, entity);
            }
        }