public virtual void Initialize(IShipmentItemMvoStateCreated stateCreated) { var aggregateId = stateCreated.ShipmentItemMvoEventId.ShipmentItemId; var state = new ShipmentItemMvoState(); state.ShipmentItemId = aggregateId; var aggregate = (ShipmentItemMvoAggregate)GetShipmentItemMvoAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public static CreateShipmentItemMvo ToCreateShipmentItemMvo(this ShipmentItemMvoState state) { return(state.ToCreateShipmentItemMvo <CreateShipmentItemMvo>()); }
public static MergePatchShipmentItemMvo ToMergePatchShipmentItemMvo(this ShipmentItemMvoState state) { return(state.ToMergePatchShipmentItemMvo <MergePatchShipmentItemMvo>()); }
public static DeleteShipmentItemMvo ToDeleteShipmentItemMvo(this ShipmentItemMvoState state) { return(state.ToDeleteShipmentItemMvo <DeleteShipmentItemMvo>()); }
public static IShipmentItemMvoCommand ToCreateOrMergePatchShipmentItemMvo(this ShipmentItemMvoState state) { return(state.ToCreateOrMergePatchShipmentItemMvo <CreateShipmentItemMvo, MergePatchShipmentItemMvo>()); }
public virtual IShipmentItemMvoState ToShipmentItemMvoState() { var state = new ShipmentItemMvoState(true); state.ShipmentItemId = this.ShipmentItemId; state.ProductId = this.ProductId; state.AttributeSetInstanceId = this.AttributeSetInstanceId; state.Quantity = this.Quantity; state.ShipmentContentDescription = this.ShipmentContentDescription; 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.ShipmentShipmentTypeId = this.ShipmentShipmentTypeId; state.ShipmentStatusId = this.ShipmentStatusId; state.ShipmentPrimaryOrderId = this.ShipmentPrimaryOrderId; state.ShipmentPrimaryReturnId = this.ShipmentPrimaryReturnId; state.ShipmentPrimaryShipGroupSeqId = this.ShipmentPrimaryShipGroupSeqId; state.ShipmentPicklistBinId = this.ShipmentPicklistBinId; state.ShipmentEstimatedReadyDate = this.ShipmentEstimatedReadyDate; state.ShipmentEstimatedShipDate = this.ShipmentEstimatedShipDate; state.ShipmentEstimatedShipWorkEffId = this.ShipmentEstimatedShipWorkEffId; state.ShipmentEstimatedArrivalDate = this.ShipmentEstimatedArrivalDate; state.ShipmentEstimatedArrivalWorkEffId = this.ShipmentEstimatedArrivalWorkEffId; state.ShipmentLatestCancelDate = this.ShipmentLatestCancelDate; state.ShipmentEstimatedShipCost = this.ShipmentEstimatedShipCost; state.ShipmentCurrencyUomId = this.ShipmentCurrencyUomId; state.ShipmentHandlingInstructions = this.ShipmentHandlingInstructions; state.ShipmentOriginFacilityId = this.ShipmentOriginFacilityId; state.ShipmentDestinationFacilityId = this.ShipmentDestinationFacilityId; state.ShipmentOriginContactMechId = this.ShipmentOriginContactMechId; state.ShipmentOriginTelecomNumberId = this.ShipmentOriginTelecomNumberId; state.ShipmentDestinationContactMechId = this.ShipmentDestinationContactMechId; state.ShipmentDestinationTelecomNumberId = this.ShipmentDestinationTelecomNumberId; state.ShipmentPartyIdTo = this.ShipmentPartyIdTo; state.ShipmentPartyIdFrom = this.ShipmentPartyIdFrom; state.ShipmentAdditionalShippingCharge = this.ShipmentAdditionalShippingCharge; state.ShipmentAddtlShippingChargeDesc = this.ShipmentAddtlShippingChargeDesc; state.ShipmentCreatedBy = this.ShipmentCreatedBy; if (this.ShipmentCreatedAt != null && this.ShipmentCreatedAt.HasValue) { state.ShipmentCreatedAt = this.ShipmentCreatedAt.Value; } state.ShipmentUpdatedBy = this.ShipmentUpdatedBy; if (this.ShipmentUpdatedAt != null && this.ShipmentUpdatedAt.HasValue) { state.ShipmentUpdatedAt = this.ShipmentUpdatedAt.Value; } if (this.ShipmentActive != null && this.ShipmentActive.HasValue) { state.ShipmentActive = this.ShipmentActive.Value; } if (this.ShipmentVersion != null && this.ShipmentVersion.HasValue) { state.ShipmentVersion = this.ShipmentVersion.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); }