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;
 }
        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);
        }
        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)
                   );
        }
 private AttributeSetStateDeleted NewAttributeSetStateDeleted(AttributeSetStateEventId stateEventId)
 {
     return(new AttributeSetStateDeleted(stateEventId));
 }
 private AttributeSetStateMergePatched NewAttributeSetStateMergePatched(AttributeSetStateEventId stateEventId)
 {
     return(new AttributeSetStateMergePatched(stateEventId));
 }
Beispiel #9
0
 public AttributeSetStateEventIdFlattenedDto(AttributeSetStateEventId val)
 {
     this._value = new AttributeSetStateEventIdDtoWrapper(val);
 }
Beispiel #10
0
 public AttributeSetStateDeleted(AttributeSetStateEventId stateEventId) : base(stateEventId)
 {
 }
Beispiel #11
0
 public AttributeSetStateMergePatched(AttributeSetStateEventId stateEventId) : base(stateEventId)
 {
 }
Beispiel #12
0
 protected AttributeSetStateEventBase(AttributeSetStateEventId stateEventId)
 {
     this.StateEventId = stateEventId;
 }