public virtual IUomTypeState ToUomTypeState() { var state = new UomTypeState(true); state.UomTypeId = this.UomTypeId; state.ParentTypeId = this.ParentTypeId; state.HasTable = this.HasTable; state.Description = this.Description; if (this.Active != null && this.Active.HasValue) { state.Active = this.Active.Value; } if (this.Version != null && this.Version.HasValue) { state.Version = this.Version.Value; } state.CreatedBy = this.CreatedBy; if (this.CreatedAt != null && this.CreatedAt.HasValue) { state.CreatedAt = this.CreatedAt.Value; } state.UpdatedBy = this.UpdatedBy; if (this.UpdatedAt != null && this.UpdatedAt.HasValue) { state.UpdatedAt = this.UpdatedAt.Value; } return(state); }
public virtual void Initialize(IUomTypeStateCreated stateCreated) { var aggregateId = stateCreated.UomTypeEventId.UomTypeId; var state = new UomTypeState(); state.UomTypeId = aggregateId; var aggregate = (UomTypeAggregate)GetUomTypeAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public static CreateUomType ToCreateUomType(this UomTypeState state) { return(state.ToCreateUomType <CreateUomType>()); }
public static MergePatchUomType ToMergePatchUomType(this UomTypeState state) { return(state.ToMergePatchUomType <MergePatchUomType>()); }
public static DeleteUomType ToDeleteUomType(this UomTypeState state) { return(state.ToDeleteUomType <DeleteUomType>()); }
public static IUomTypeCommand ToCreateOrMergePatchUomType(this UomTypeState state) { return(state.ToCreateOrMergePatchUomType <CreateUomType, MergePatchUomType>()); }