public virtual IAttributeValueState Get(string value, bool forCreation, bool nullAllowed)
        {
            AttributeValueId globalId = new AttributeValueId(_attributeState.AttributeId, value);

            if (_loadedAttributeValueStates.ContainsKey(globalId))
            {
                return(_loadedAttributeValueStates[globalId]);
            }
            if (forCreation || ForReapplying)
            {
                var state = new AttributeValueState(ForReapplying);
                state.AttributeValueId = globalId;
                _loadedAttributeValueStates.Add(globalId, state);
                return(state);
            }
            else
            {
                var state = AttributeValueStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedAttributeValueStates.Add(globalId, state);
                }
                return(state);
            }
        }
Exemple #2
0
        public virtual AttributeValueId ToAttributeValueId()
        {
            AttributeValueId v = new AttributeValueId();

            v.AttributeId = this.AttributeId;
            v.Value       = this.Value;
            return(v);
        }
 public AttributeValueIdDtoWrapper(AttributeValueId val)
 {
     if (val == null)
     {
         throw new ArgumentNullException("val");
     }
     this._value = val;
 }
Exemple #4
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            AttributeValueId other = obj as AttributeValueId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.AttributeId, other.AttributeId) &&
                   Object.Equals(this.Value, other.Value)
                   );
        }
 public AttributeValueIdFlattenedDto(AttributeValueId val)
 {
     this._value = new AttributeValueIdDtoWrapper(val);
 }