Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
 public static CreateProductCategoryMember ToCreateProductCategoryMember(this ProductCategoryMemberState state)
 {
     return(state.ToCreateProductCategoryMember <CreateProductCategoryMember>());
 }
Example #4
0
 public static MergePatchProductCategoryMember ToMergePatchProductCategoryMember(this ProductCategoryMemberState state)
 {
     return(state.ToMergePatchProductCategoryMember <MergePatchProductCategoryMember>());
 }
Example #5
0
 public static DeleteProductCategoryMember ToDeleteProductCategoryMember(this ProductCategoryMemberState state)
 {
     return(state.ToDeleteProductCategoryMember <DeleteProductCategoryMember>());
 }
Example #6
0
 public static IProductCategoryMemberCommand ToCreateOrMergePatchProductCategoryMember(this ProductCategoryMemberState state)
 {
     return(state.ToCreateOrMergePatchProductCategoryMember <CreateProductCategoryMember, MergePatchProductCategoryMember>());
 }