public virtual IGoodIdentificationTypeState ToGoodIdentificationTypeState() { var state = new GoodIdentificationTypeState(true); state.GoodIdentificationTypeId = this.GoodIdentificationTypeId; 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(IGoodIdentificationTypeStateCreated stateCreated) { var aggregateId = stateCreated.GoodIdentificationTypeEventId.GoodIdentificationTypeId; var state = new GoodIdentificationTypeState(); state.GoodIdentificationTypeId = aggregateId; var aggregate = (GoodIdentificationTypeAggregate)GetGoodIdentificationTypeAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public static CreateGoodIdentificationType ToCreateGoodIdentificationType(this GoodIdentificationTypeState state) { return(state.ToCreateGoodIdentificationType <CreateGoodIdentificationType>()); }
public static MergePatchGoodIdentificationType ToMergePatchGoodIdentificationType(this GoodIdentificationTypeState state) { return(state.ToMergePatchGoodIdentificationType <MergePatchGoodIdentificationType>()); }
public static DeleteGoodIdentificationType ToDeleteGoodIdentificationType(this GoodIdentificationTypeState state) { return(state.ToDeleteGoodIdentificationType <DeleteGoodIdentificationType>()); }
public static IGoodIdentificationTypeCommand ToCreateOrMergePatchGoodIdentificationType(this GoodIdentificationTypeState state) { return(state.ToCreateOrMergePatchGoodIdentificationType <CreateGoodIdentificationType, MergePatchGoodIdentificationType>()); }