Beispiel #1
0
        public virtual void When(IWarehouseStateDeleted e)
        {
            ThrowOnWrongEvent(e);

            this.Deleted   = true;
            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
Beispiel #2
0
        public virtual WarehouseStateDeletedDto ToWarehouseStateDeletedDto(IWarehouseStateDeleted e)
        {
            var dto = new WarehouseStateDeletedDto();

            dto.StateEventId = new WarehouseStateEventIdDtoWrapper(e.StateEventId);
            dto.CreatedAt    = e.CreatedAt;
            dto.CreatedBy    = e.CreatedBy;
            dto.CommandId    = e.CommandId;

            return(dto);
        }
Beispiel #3
0
        protected virtual IWarehouseStateDeleted Map(IDeleteWarehouse c)
        {
            var stateEventId         = new WarehouseEventId(c.WarehouseId, c.Version);
            IWarehouseStateDeleted e = NewWarehouseStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();


            return(e);
        }
Beispiel #4
0
        protected virtual IWarehouseStateDeleted Map(IDeleteWarehouse c)
        {
            var stateEventId         = new WarehouseStateEventId(c.WarehouseId, c.Version);
            IWarehouseStateDeleted e = NewWarehouseStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


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


            return(e);
        }
Beispiel #5
0
        protected virtual IWarehouseStateDeleted Map(IDeleteWarehouse c)
        {
            var stateEventId         = new WarehouseStateEventId(c.WarehouseId, c.Version);
            IWarehouseStateDeleted e = NewWarehouseStateDeleted(stateEventId);

            ReflectUtils.CopyPropertyValue("CommandId", c, e);


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


            return(e);
        }
 public void AddWarehouseEvent(IWarehouseStateDeleted e)
 {
     _innerStateEvents.Add((WarehouseStateDeletedDto)e);
 }
 void IWarehouseState.When(IWarehouseStateDeleted e)
 {
     throw new NotSupportedException();
 }
Beispiel #8
0
        public virtual void Delete(IDeleteWarehouse c)
        {
            IWarehouseStateDeleted e = Map(c);

            Apply(e);
        }