public virtual void Initialize(IOrderItemShipGroupAssociationMvoStateCreated stateCreated)
        {
            var aggregateId = stateCreated.OrderItemShipGroupAssociationMvoEventId.OrderItemShipGroupAssociationId;
            var state       = new OrderItemShipGroupAssociationMvoState();

            state.OrderItemShipGroupAssociationId = aggregateId;
            var aggregate = (OrderItemShipGroupAssociationMvoAggregate)GetOrderItemShipGroupAssociationMvoAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
 public static CreateOrderItemShipGroupAssociationMvo ToCreateOrderItemShipGroupAssociationMvo(this OrderItemShipGroupAssociationMvoState state)
 {
     return(state.ToCreateOrderItemShipGroupAssociationMvo <CreateOrderItemShipGroupAssociationMvo>());
 }
 public static MergePatchOrderItemShipGroupAssociationMvo ToMergePatchOrderItemShipGroupAssociationMvo(this OrderItemShipGroupAssociationMvoState state)
 {
     return(state.ToMergePatchOrderItemShipGroupAssociationMvo <MergePatchOrderItemShipGroupAssociationMvo>());
 }
 public static IOrderItemShipGroupAssociationMvoCommand ToCreateOrMergePatchOrderItemShipGroupAssociationMvo(this OrderItemShipGroupAssociationMvoState state)
 {
     return(state.ToCreateOrMergePatchOrderItemShipGroupAssociationMvo <CreateOrderItemShipGroupAssociationMvo, MergePatchOrderItemShipGroupAssociationMvo>());
 }
        public virtual IOrderItemShipGroupAssociationMvoState ToOrderItemShipGroupAssociationMvoState()
        {
            var state = new OrderItemShipGroupAssociationMvoState(true);

            state.OrderItemShipGroupAssociationId = this.OrderItemShipGroupAssociationId;
            state.Quantity       = this.Quantity;
            state.CancelQuantity = this.CancelQuantity;
            if (this.Version != null && this.Version.HasValue)
            {
                state.Version = this.Version.Value;
            }
            if (this.Active != null && this.Active.HasValue)
            {
                state.Active = this.Active.Value;
            }
            state.OrderShipGroupShipmentMethodTypeId = this.OrderShipGroupShipmentMethodTypeId;
            state.OrderShipGroupSupplierPartyId      = this.OrderShipGroupSupplierPartyId;
            state.OrderShipGroupVendorPartyId        = this.OrderShipGroupVendorPartyId;
            state.OrderShipGroupCarrierPartyId       = this.OrderShipGroupCarrierPartyId;
            state.OrderShipGroupCarrierRoleTypeId    = this.OrderShipGroupCarrierRoleTypeId;
            state.OrderShipGroupFacilityId           = this.OrderShipGroupFacilityId;
            state.OrderShipGroupContactMechId        = this.OrderShipGroupContactMechId;
            state.OrderShipGroupTelecomContactMechId = this.OrderShipGroupTelecomContactMechId;
            state.OrderShipGroupTrackingNumber       = this.OrderShipGroupTrackingNumber;
            state.OrderShipGroupShippingInstructions = this.OrderShipGroupShippingInstructions;
            state.OrderShipGroupMaySplit             = this.OrderShipGroupMaySplit;
            state.OrderShipGroupGiftMessage          = this.OrderShipGroupGiftMessage;
            state.OrderShipGroupIsGift                = this.OrderShipGroupIsGift;
            state.OrderShipGroupShipAfterDate         = this.OrderShipGroupShipAfterDate;
            state.OrderShipGroupShipByDate            = this.OrderShipGroupShipByDate;
            state.OrderShipGroupEstimatedShipDate     = this.OrderShipGroupEstimatedShipDate;
            state.OrderShipGroupEstimatedDeliveryDate = this.OrderShipGroupEstimatedDeliveryDate;
            state.OrderShipGroupPickwaveId            = this.OrderShipGroupPickwaveId;
            if (this.OrderShipGroupVersion != null && this.OrderShipGroupVersion.HasValue)
            {
                state.OrderShipGroupVersion = this.OrderShipGroupVersion.Value;
            }
            state.OrderShipGroupCreatedBy = this.OrderShipGroupCreatedBy;
            if (this.OrderShipGroupCreatedAt != null && this.OrderShipGroupCreatedAt.HasValue)
            {
                state.OrderShipGroupCreatedAt = this.OrderShipGroupCreatedAt.Value;
            }
            state.OrderShipGroupUpdatedBy = this.OrderShipGroupUpdatedBy;
            if (this.OrderShipGroupUpdatedAt != null && this.OrderShipGroupUpdatedAt.HasValue)
            {
                state.OrderShipGroupUpdatedAt = this.OrderShipGroupUpdatedAt.Value;
            }
            if (this.OrderShipGroupActive != null && this.OrderShipGroupActive.HasValue)
            {
                state.OrderShipGroupActive = this.OrderShipGroupActive.Value;
            }
            if (this.OrderShipGroupDeleted != null && this.OrderShipGroupDeleted.HasValue)
            {
                state.OrderShipGroupDeleted = this.OrderShipGroupDeleted.Value;
            }
            state.OrderOrderTypeId             = this.OrderOrderTypeId;
            state.OrderOrderName               = this.OrderOrderName;
            state.OrderExternalId              = this.OrderExternalId;
            state.OrderSalesChannelEnumId      = this.OrderSalesChannelEnumId;
            state.OrderOrderDate               = this.OrderOrderDate;
            state.OrderPriority                = this.OrderPriority;
            state.OrderEntryDate               = this.OrderEntryDate;
            state.OrderPickSheetPrintedDate    = this.OrderPickSheetPrintedDate;
            state.OrderStatusId                = this.OrderStatusId;
            state.OrderCurrencyUom             = this.OrderCurrencyUom;
            state.OrderSyncStatusId            = this.OrderSyncStatusId;
            state.OrderBillingAccountId        = this.OrderBillingAccountId;
            state.OrderOriginFacilityId        = this.OrderOriginFacilityId;
            state.OrderWebSiteId               = this.OrderWebSiteId;
            state.OrderProductStoreId          = this.OrderProductStoreId;
            state.OrderTerminalId              = this.OrderTerminalId;
            state.OrderTransactionId           = this.OrderTransactionId;
            state.OrderAutoOrderShoppingListId = this.OrderAutoOrderShoppingListId;
            state.OrderNeedsInventoryIssuance  = this.OrderNeedsInventoryIssuance;
            state.OrderIsRushOrder             = this.OrderIsRushOrder;
            state.OrderInternalCode            = this.OrderInternalCode;
            state.OrderRemainingSubTotal       = this.OrderRemainingSubTotal;
            state.OrderGrandTotal              = this.OrderGrandTotal;
            state.OrderInvoicePerShipment      = this.OrderInvoicePerShipment;
            state.OrderCreatedBy               = this.OrderCreatedBy;
            if (this.OrderCreatedAt != null && this.OrderCreatedAt.HasValue)
            {
                state.OrderCreatedAt = this.OrderCreatedAt.Value;
            }
            state.OrderUpdatedBy = this.OrderUpdatedBy;
            if (this.OrderUpdatedAt != null && this.OrderUpdatedAt.HasValue)
            {
                state.OrderUpdatedAt = this.OrderUpdatedAt.Value;
            }
            if (this.OrderActive != null && this.OrderActive.HasValue)
            {
                state.OrderActive = this.OrderActive.Value;
            }
            if (this.OrderVersion != null && this.OrderVersion.HasValue)
            {
                state.OrderVersion = this.OrderVersion.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);
        }