public virtual void When(IInOutImageStateMergePatched 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; }
}// END Map(ICreate... //////////////////////////// protected virtual IInOutImageStateMergePatched MapMergePatch(IMergePatchInOutImage c, IInOutCommand outerCommand, long version, IInOutState outerState) { c.RequesterId = outerCommand.RequesterId; var stateEventId = new InOutImageEventId(c.InOutDocumentNumber, c.SequenceId, version); IInOutImageStateMergePatched e = NewInOutImageStateMergePatched(stateEventId); var s = outerState.InOutImages.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... ////////////////////////////
void IInOutImageState.When(IInOutImageStateMergePatched e) { throw new NotSupportedException(); }
public virtual InOutImageStateMergePatchedDto ToInOutImageStateMergePatchedDto(IInOutImageStateMergePatched e) { var dto = new InOutImageStateMergePatchedDto(); dto.InOutImageEventId = e.InOutImageEventId; 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); }