protected virtual IStatusItemStateMergePatched Map(IMergePatchStatusItem c) { var stateEventId = new StatusItemEventId(c.StatusId, c.Version); IStatusItemStateMergePatched e = NewStatusItemStateMergePatched(stateEventId); e.StatusTypeId = c.StatusTypeId; e.StatusCode = c.StatusCode; e.SequenceId = c.SequenceId; e.Description = c.Description; e.Active = c.Active; e.IsPropertyStatusTypeIdRemoved = c.IsPropertyStatusTypeIdRemoved; e.IsPropertyStatusCodeRemoved = c.IsPropertyStatusCodeRemoved; e.IsPropertySequenceIdRemoved = c.IsPropertySequenceIdRemoved; 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); }
void IStatusItemState.When(IStatusItemStateMergePatched e) { throw new NotSupportedException(); }
public virtual void When(IStatusItemStateMergePatched e) { ThrowOnWrongEvent(e); if (e.StatusTypeId == null) { if (e.IsPropertyStatusTypeIdRemoved) { this.StatusTypeId = default(string); } } else { this.StatusTypeId = e.StatusTypeId; } if (e.StatusCode == null) { if (e.IsPropertyStatusCodeRemoved) { this.StatusCode = default(string); } } else { this.StatusCode = e.StatusCode; } if (e.SequenceId == null) { if (e.IsPropertySequenceIdRemoved) { this.SequenceId = default(string); } } else { this.SequenceId = e.SequenceId; } 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; }
public virtual void MergePatch(IMergePatchStatusItem c) { IStatusItemStateMergePatched e = Map(c); Apply(e); }
public virtual StatusItemStateMergePatchedDto ToStatusItemStateMergePatchedDto(IStatusItemStateMergePatched e) { var dto = new StatusItemStateMergePatchedDto(); dto.StatusItemEventId = e.StatusItemEventId; dto.CreatedAt = e.CreatedAt; dto.CreatedBy = e.CreatedBy; dto.CommandId = e.CommandId; dto.StatusTypeId = e.StatusTypeId; dto.StatusCode = e.StatusCode; dto.SequenceId = e.SequenceId; dto.Description = e.Description; dto.Active = e.Active; dto.IsPropertyStatusTypeIdRemoved = e.IsPropertyStatusTypeIdRemoved; dto.IsPropertyStatusCodeRemoved = e.IsPropertyStatusCodeRemoved; dto.IsPropertySequenceIdRemoved = e.IsPropertySequenceIdRemoved; dto.IsPropertyDescriptionRemoved = e.IsPropertyDescriptionRemoved; dto.IsPropertyActiveRemoved = e.IsPropertyActiveRemoved; return(dto); }