示例#1
0
        protected virtual IWarehouseStateMergePatched Map(IMergePatchWarehouse c)
        {
            var stateEventId = new WarehouseEventId(c.WarehouseId, c.Version);
            IWarehouseStateMergePatched e = NewWarehouseStateMergePatched(stateEventId);

            e.WarehouseName = c.WarehouseName;
            e.Description   = c.Description;
            e.IsInTransit   = c.IsInTransit;
            e.Active        = c.Active;
            e.IsPropertyWarehouseNameRemoved = c.IsPropertyWarehouseNameRemoved;
            e.IsPropertyDescriptionRemoved   = c.IsPropertyDescriptionRemoved;
            e.IsPropertyIsInTransitRemoved   = c.IsPropertyIsInTransitRemoved;
            e.IsPropertyActiveRemoved        = c.IsPropertyActiveRemoved;

            e.CommandId = c.CommandId;


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

            var version = c.Version;


            return(e);
        }
示例#2
0
        protected virtual IWarehouseStateMergePatched Map(IMergePatchWarehouse c)
        {
            var stateEventId = new WarehouseStateEventId(c.WarehouseId, c.Version);
            IWarehouseStateMergePatched e = NewWarehouseStateMergePatched(stateEventId);

            e.Name                         = c.Name;
            e.Description                  = c.Description;
            e.IsInTransit                  = c.IsInTransit;
            e.Active                       = c.Active;
            e.IsPropertyNameRemoved        = c.IsPropertyNameRemoved;
            e.IsPropertyDescriptionRemoved = c.IsPropertyDescriptionRemoved;
            e.IsPropertyIsInTransitRemoved = c.IsPropertyIsInTransitRemoved;
            e.IsPropertyActiveRemoved      = c.IsPropertyActiveRemoved;

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


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

            var version = c.Version;


            return(e);
        }
 public virtual void When(IMergePatchWarehouse c)
 {
     Update(c, ar => ar.MergePatch(c));
 }
 void IWarehouseApplicationService.When(IMergePatchWarehouse c)
 {
     this.When((MergePatchWarehouseDto)c);
 }
示例#5
0
        public virtual void MergePatch(IMergePatchWarehouse c)
        {
            IWarehouseStateMergePatched e = Map(c);

            Apply(e);
        }