예제 #1
0
        public bool CheckOrCreateUserRecord(IUser user)
        {
            bool   isSuccess     = false;
            bool   existsInCache = false;
            string userName      = user.Username;
            int    userId        = user.DiscriminatorValue;

            if ((existsInCache = IsUserRecordExistCache(userId)) ||
                CheckUserRecordExists(userId) ||
                (CreateNewUserRecord(userId, userName))
                )
            {
                isSuccess = true;
            }

            if (!existsInCache && isSuccess)
            {
                UserRecordExistenceSet.Add(userId);
            }

            return(isSuccess);
        }
예제 #2
0
 private bool IsUserRecordExistCache(int userId)
 {
     return(UserRecordExistenceSet.Contains(userId));
 }