コード例 #1
0
        public virtual IAttributeValueState Get(string value)
		{
			AttributeValueId globalId = new AttributeValueId(_attributeState.AttributeId, value);
            if (_loadedAttributeValueStates.ContainsKey(globalId)) {
                return _loadedAttributeValueStates[globalId];
            }
            var state = AttributeValueStateDao.Get(globalId);
			_loadedAttributeValueStates.Add (globalId, state);
			return state;
		}
コード例 #2
0
        public virtual IAttributeValueMvoStateEvent GetStateEvent(AttributeValueId attributeValueId, long version)
        {
            var e = (IAttributeValueMvoStateEvent)EventStore.GetStateEvent(ToEventStoreAggregateId(attributeValueId), version);

            if (e != null)
            {
                e.ReadOnly = true;
            }
            return(e);
        }
コード例 #3
0
        public virtual IAttributeValueMvoState Get(AttributeValueId attributeValueId)
        {
            var state = StateRepository.Get(attributeValueId);

            if (state != null && state.IsUnsaved)
            {
                state = null;
            }

            return(state);
        }
コード例 #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)
                   );
        }
コード例 #5
0
 public AttributeValueIdDto(AttributeValueId val)
 {
     this._value = val;
 }
コード例 #6
0
 public AttributeValueMvoStateEventId(AttributeValueId attributeValueId, long attributeVersion)
 {
     this._attributeValueId = attributeValueId;
     this._attributeVersion = attributeVersion;
 }
コード例 #7
0
 public abstract IEventStoreAggregateId ToEventStoreAggregateId(AttributeValueId aggregateId);