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; }
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); }
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); }
void IRejectionReasonState.When(IRejectionReasonStateMergePatched e) { throw new NotSupportedException(); }