public virtual IProductCategoryMemberState ToProductCategoryMemberState() { var state = new ProductCategoryMemberState(true); state.ProductCategoryMemberId = this.ProductCategoryMemberId; state.ThruDate = this.ThruDate; state.Comments = this.Comments; state.SequenceNum = this.SequenceNum; state.Quantity = this.Quantity; 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(IProductCategoryMemberStateCreated stateCreated) { var aggregateId = stateCreated.ProductCategoryMemberEventId.ProductCategoryMemberId; var state = new ProductCategoryMemberState(); state.ProductCategoryMemberId = aggregateId; var aggregate = (ProductCategoryMemberAggregate)GetProductCategoryMemberAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public static CreateProductCategoryMember ToCreateProductCategoryMember(this ProductCategoryMemberState state) { return(state.ToCreateProductCategoryMember <CreateProductCategoryMember>()); }
public static MergePatchProductCategoryMember ToMergePatchProductCategoryMember(this ProductCategoryMemberState state) { return(state.ToMergePatchProductCategoryMember <MergePatchProductCategoryMember>()); }
public static DeleteProductCategoryMember ToDeleteProductCategoryMember(this ProductCategoryMemberState state) { return(state.ToDeleteProductCategoryMember <DeleteProductCategoryMember>()); }
public static IProductCategoryMemberCommand ToCreateOrMergePatchProductCategoryMember(this ProductCategoryMemberState state) { return(state.ToCreateOrMergePatchProductCategoryMember <CreateProductCategoryMember, MergePatchProductCategoryMember>()); }