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