示例#1
0
        protected virtual IAttributeSetStateCreated Map(ICreateAttributeSet c)
        {
            var stateEventId            = new AttributeSetStateEventId(c.AttributeSetId, c.Version);
            IAttributeSetStateCreated e = NewAttributeSetStateCreated(stateEventId);

            e.Name                    = c.Name;
            e.OrganizationId          = c.OrganizationId;
            e.Description             = c.Description;
            e.SerialNumberAttributeId = c.SerialNumberAttributeId;
            e.LotAttributeId          = c.LotAttributeId;
            e.ReferenceId             = c.ReferenceId;
            e.Active                  = c.Active;
            e.CommandId               = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = DateTime.Now;
            var version = c.Version;

            foreach (ICreateAttributeUse innerCommand in c.AttributeUses)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IAttributeUseStateCreated innerEvent = MapCreate(innerCommand, c, version, _state);
                e.AddAttributeUseEvent(innerEvent);
            }


            return(e);
        }
        public virtual AttributeSetStateEventId ToAttributeSetStateEventId()
        {
            AttributeSetStateEventId v = new AttributeSetStateEventId();

            v.AttributeSetId = this.AttributeSetId;
            v.Version        = this.Version;
            return(v);
        }
 public AttributeSetStateEventIdDtoWrapper(AttributeSetStateEventId val)
 {
     if (val == null)
     {
         throw new ArgumentNullException("val");
     }
     this._value = val;
 }
示例#4
0
        protected AttributeSetStateDeleted NewAttributeSetStateDeleted(string commandId, string requesterId)
        {
            var stateEventId = new AttributeSetStateEventId(_state.AttributeSetId, ((IAttributeSetStateProperties)_state).Version);
            var e            = NewAttributeSetStateDeleted(stateEventId);

            e.CommandId = commandId;

            e.CreatedBy = (string)requesterId;
            e.CreatedAt = DateTime.Now;

            return(e);
        }
示例#5
0
        protected virtual IAttributeSetStateDeleted Map(IDeleteAttributeSet c)
        {
            var stateEventId            = new AttributeSetStateEventId(c.AttributeSetId, c.Version);
            IAttributeSetStateDeleted e = NewAttributeSetStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = DateTime.Now;


            return(e);
        }
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            AttributeSetStateEventId other = obj as AttributeSetStateEventId;

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

            return(true &&
                   Object.Equals(this.AttributeSetId, other.AttributeSetId) &&
                   Object.Equals(this.Version, other.Version)
                   );
        }
示例#7
0
 private AttributeSetStateDeleted NewAttributeSetStateDeleted(AttributeSetStateEventId stateEventId)
 {
     return(new AttributeSetStateDeleted(stateEventId));
 }
示例#8
0
 private AttributeSetStateMergePatched NewAttributeSetStateMergePatched(AttributeSetStateEventId stateEventId)
 {
     return(new AttributeSetStateMergePatched(stateEventId));
 }
示例#9
0
 public AttributeSetStateEventIdFlattenedDto(AttributeSetStateEventId val)
 {
     this._value = new AttributeSetStateEventIdDtoWrapper(val);
 }
示例#10
0
 public AttributeSetStateDeleted(AttributeSetStateEventId stateEventId) : base(stateEventId)
 {
 }
示例#11
0
 public AttributeSetStateMergePatched(AttributeSetStateEventId stateEventId) : base(stateEventId)
 {
 }
示例#12
0
 protected AttributeSetStateEventBase(AttributeSetStateEventId stateEventId)
 {
     this.StateEventId = stateEventId;
 }