Пример #1
0
        public virtual void When(IShipmentImageStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.Url == null)
            {
                if (e.IsPropertyUrlRemoved)
                {
                    this.Url = default(string);
                }
            }
            else
            {
                this.Url = e.Url;
            }

            if (e.Active == null)
            {
                if (e.IsPropertyActiveRemoved)
                {
                    this.Active = default(bool);
                }
            }
            else
            {
                this.Active = (e.Active != null && e.Active.HasValue) ? e.Active.Value : default(bool);
            }


            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
Пример #2
0
        }// END Map(ICreate... ////////////////////////////

        protected virtual IShipmentImageStateMergePatched MapMergePatch(IMergePatchShipmentImage c, IShipmentCommand outerCommand, long version, IShipmentState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new ShipmentImageEventId(c.ShipmentId, c.SequenceId, version);
            IShipmentImageStateMergePatched e = NewShipmentImageStateMergePatched(stateEventId);
            var s = outerState.ShipmentImages.Get(c.SequenceId);

            e.Url    = c.Url;
            e.Active = c.Active;
            e.IsPropertyUrlRemoved    = c.IsPropertyUrlRemoved;
            e.IsPropertyActiveRemoved = c.IsPropertyActiveRemoved;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            return(e);
        }// END Map(IMergePatch... ////////////////////////////
Пример #3
0
 void IShipmentImageState.When(IShipmentImageStateMergePatched e)
 {
     throw new NotSupportedException();
 }
Пример #4
0
        public virtual ShipmentImageStateMergePatchedDto ToShipmentImageStateMergePatchedDto(IShipmentImageStateMergePatched e)
        {
            var dto = new ShipmentImageStateMergePatchedDto();

            dto.ShipmentImageEventId = e.ShipmentImageEventId;
            dto.CreatedAt            = e.CreatedAt;
            dto.CreatedBy            = e.CreatedBy;
            dto.Version                 = e.Version;
            dto.CommandId               = e.CommandId;
            dto.Url                     = e.Url;
            dto.Active                  = e.Active;
            dto.IsPropertyUrlRemoved    = e.IsPropertyUrlRemoved;
            dto.IsPropertyActiveRemoved = e.IsPropertyActiveRemoved;

            return(dto);
        }