Esempio n. 1
0
        public virtual void When(IRejectionReasonStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.Description == null)
            {
                if (e.IsPropertyDescriptionRemoved)
                {
                    this.Description = default(string);
                }
            }
            else
            {
                this.Description = e.Description;
            }

            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;
        }
Esempio n. 2
0
        protected virtual IRejectionReasonStateMergePatched Map(IMergePatchRejectionReason c)
        {
            var stateEventId = new RejectionReasonEventId(c.RejectionReasonId, c.Version);
            IRejectionReasonStateMergePatched e = NewRejectionReasonStateMergePatched(stateEventId);

            e.Description = c.Description;
            e.Active      = c.Active;
            e.IsPropertyDescriptionRemoved = c.IsPropertyDescriptionRemoved;
            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);
        }
Esempio n. 3
0
        public virtual void MergePatch(IMergePatchRejectionReason c)
        {
            IRejectionReasonStateMergePatched e = Map(c);

            Apply(e);
        }
        public virtual RejectionReasonStateMergePatchedDto ToRejectionReasonStateMergePatchedDto(IRejectionReasonStateMergePatched e)
        {
            var dto = new RejectionReasonStateMergePatchedDto();

            dto.RejectionReasonEventId = e.RejectionReasonEventId;
            dto.CreatedAt   = e.CreatedAt;
            dto.CreatedBy   = e.CreatedBy;
            dto.CommandId   = e.CommandId;
            dto.Description = e.Description;
            dto.Active      = e.Active;
            dto.IsPropertyDescriptionRemoved = e.IsPropertyDescriptionRemoved;
            dto.IsPropertyActiveRemoved      = e.IsPropertyActiveRemoved;

            return(dto);
        }
Esempio n. 5
0
 void IRejectionReasonState.When(IRejectionReasonStateMergePatched e)
 {
     throw new NotSupportedException();
 }