public virtual void When(IGoodIdentificationStateMergePatched e) { ThrowOnWrongEvent(e); if (e.IdValue == null) { if (e.IsPropertyIdValueRemoved) { this.IdValue = default(string); } } else { this.IdValue = e.IdValue; } 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 IGoodIdentificationStateMergePatched MapMergePatch(IMergePatchGoodIdentification c, IProductCommand outerCommand, long version, IProductState outerState) { c.RequesterId = outerCommand.RequesterId; var stateEventId = new GoodIdentificationEventId(c.ProductId, c.GoodIdentificationTypeId, version); IGoodIdentificationStateMergePatched e = NewGoodIdentificationStateMergePatched(stateEventId); var s = outerState.GoodIdentifications.Get(c.GoodIdentificationTypeId); e.IdValue = c.IdValue; e.Active = c.Active; e.IsPropertyIdValueRemoved = c.IsPropertyIdValueRemoved; e.IsPropertyActiveRemoved = c.IsPropertyActiveRemoved; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }// END Map(IMergePatch... ////////////////////////////
public virtual GoodIdentificationStateMergePatchedDto ToGoodIdentificationStateMergePatchedDto(IGoodIdentificationStateMergePatched e) { var dto = new GoodIdentificationStateMergePatchedDto(); dto.GoodIdentificationEventId = e.GoodIdentificationEventId; dto.CreatedAt = e.CreatedAt; dto.CreatedBy = e.CreatedBy; dto.Version = e.Version; dto.CommandId = e.CommandId; dto.IdValue = e.IdValue; dto.Active = e.Active; dto.IsPropertyIdValueRemoved = e.IsPropertyIdValueRemoved; dto.IsPropertyActiveRemoved = e.IsPropertyActiveRemoved; return(dto); }
void IGoodIdentificationState.When(IGoodIdentificationStateMergePatched e) { throw new NotSupportedException(); }