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); } }
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); }