示例#1
0
        public virtual IUserClaimState Get(int claimId, bool forCreation, bool nullAllowed)
        {
            UserClaimId globalId = new UserClaimId(_userState.UserId, claimId);

            if (_loadedUserClaimStates.ContainsKey(globalId))
            {
                return(_loadedUserClaimStates[globalId]);
            }
            if (forCreation || ForReapplying)
            {
                var state = new UserClaimState(ForReapplying);
                state.UserClaimId = globalId;
                _loadedUserClaimStates.Add(globalId, state);
                return(state);
            }
            else
            {
                var state = UserClaimStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedUserClaimStates.Add(globalId, state);
                }
                return(state);
            }
        }
示例#2
0
        public virtual IUserClaimState Get(int claimId)
        {
            UserClaimId globalId = new UserClaimId(_userState.UserId, claimId);

            if (_loadedUserClaimStates.ContainsKey(globalId))
            {
                return(_loadedUserClaimStates[globalId]);
            }
            var state = UserClaimStateDao.Get(globalId);

            _loadedUserClaimStates.Add(globalId, state);
            return(state);
        }