public virtual IAttributeUseState Get(string attributeId, bool forCreation, bool nullAllowed) { AttributeSetAttributeUseId globalId = new AttributeSetAttributeUseId(_attributeSetState.AttributeSetId, attributeId); if (_loadedAttributeUseStates.ContainsKey(globalId)) { return(_loadedAttributeUseStates[globalId]); } if (forCreation || ForReapplying) { var state = new AttributeUseState(ForReapplying); state.AttributeSetAttributeUseId = globalId; _loadedAttributeUseStates.Add(globalId, state); return(state); } else { var state = AttributeUseStateDao.Get(globalId, nullAllowed); if (state != null) { _loadedAttributeUseStates.Add(globalId, state); } return(state); } }
public virtual IAttributeUseState Get(string attributeId) { AttributeSetAttributeUseId globalId = new AttributeSetAttributeUseId(_attributeSetState.AttributeSetId, attributeId); if (_loadedAttributeUseStates.ContainsKey(globalId)) { return(_loadedAttributeUseStates[globalId]); } var state = AttributeUseStateDao.Get(globalId); _loadedAttributeUseStates.Add(globalId, state); return(state); }