public virtual void Initialize(IGoodIdentificationMvoStateCreated stateCreated)
        {
            var aggregateId = stateCreated.GoodIdentificationMvoEventId.ProductGoodIdentificationId;
            var state       = new GoodIdentificationMvoState();

            state.ProductGoodIdentificationId = aggregateId;
            var aggregate = (GoodIdentificationMvoAggregate)GetGoodIdentificationMvoAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
예제 #2
0
        public virtual IGoodIdentificationMvoState ToGoodIdentificationMvoState()
        {
            var state = new GoodIdentificationMvoState(true);

            state.ProductGoodIdentificationId = this.ProductGoodIdentificationId;
            state.IdValue = this.IdValue;
            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.ProductProductTypeId            = this.ProductProductTypeId;
            state.ProductPrimaryProductCategoryId = this.ProductPrimaryProductCategoryId;
            state.ProductManufacturerPartyId      = this.ProductManufacturerPartyId;
            state.ProductFacilityId                 = this.ProductFacilityId;
            state.ProductIntroductionDate           = this.ProductIntroductionDate;
            state.ProductReleaseDate                = this.ProductReleaseDate;
            state.ProductSupportDiscontinuationDate = this.ProductSupportDiscontinuationDate;
            state.ProductSalesDiscontinuationDate   = this.ProductSalesDiscontinuationDate;
            state.ProductSalesDiscWhenNotAvail      = this.ProductSalesDiscWhenNotAvail;
            state.ProductInternalName               = this.ProductInternalName;
            state.ProductBrandName                = this.ProductBrandName;
            state.ProductComments                 = this.ProductComments;
            state.ProductProductName              = this.ProductProductName;
            state.ProductDescription              = this.ProductDescription;
            state.ProductPriceDetailText          = this.ProductPriceDetailText;
            state.ProductSmallImageUrl            = this.ProductSmallImageUrl;
            state.ProductMediumImageUrl           = this.ProductMediumImageUrl;
            state.ProductLargeImageUrl            = this.ProductLargeImageUrl;
            state.ProductDetailImageUrl           = this.ProductDetailImageUrl;
            state.ProductOriginalImageUrl         = this.ProductOriginalImageUrl;
            state.ProductDetailScreen             = this.ProductDetailScreen;
            state.ProductInventoryMessage         = this.ProductInventoryMessage;
            state.ProductInventoryItemTypeId      = this.ProductInventoryItemTypeId;
            state.ProductRequireInventory         = this.ProductRequireInventory;
            state.ProductQuantityUomId            = this.ProductQuantityUomId;
            state.ProductQuantityIncluded         = this.ProductQuantityIncluded;
            state.ProductPiecesIncluded           = this.ProductPiecesIncluded;
            state.ProductRequireAmount            = this.ProductRequireAmount;
            state.ProductFixedAmount              = this.ProductFixedAmount;
            state.ProductAmountUomTypeId          = this.ProductAmountUomTypeId;
            state.ProductWeightUomId              = this.ProductWeightUomId;
            state.ProductShippingWeight           = this.ProductShippingWeight;
            state.ProductProductWeight            = this.ProductProductWeight;
            state.ProductHeightUomId              = this.ProductHeightUomId;
            state.ProductProductHeight            = this.ProductProductHeight;
            state.ProductShippingHeight           = this.ProductShippingHeight;
            state.ProductWidthUomId               = this.ProductWidthUomId;
            state.ProductProductWidth             = this.ProductProductWidth;
            state.ProductShippingWidth            = this.ProductShippingWidth;
            state.ProductDepthUomId               = this.ProductDepthUomId;
            state.ProductProductDepth             = this.ProductProductDepth;
            state.ProductShippingDepth            = this.ProductShippingDepth;
            state.ProductDiameterUomId            = this.ProductDiameterUomId;
            state.ProductProductDiameter          = this.ProductProductDiameter;
            state.ProductProductRating            = this.ProductProductRating;
            state.ProductRatingTypeEnum           = this.ProductRatingTypeEnum;
            state.ProductReturnable               = this.ProductReturnable;
            state.ProductTaxable                  = this.ProductTaxable;
            state.ProductChargeShipping           = this.ProductChargeShipping;
            state.ProductAutoCreateKeywords       = this.ProductAutoCreateKeywords;
            state.ProductIncludeInPromotions      = this.ProductIncludeInPromotions;
            state.ProductIsVirtual                = this.ProductIsVirtual;
            state.ProductIsVariant                = this.ProductIsVariant;
            state.ProductVirtualVariantMethodEnum = this.ProductVirtualVariantMethodEnum;
            state.ProductInShippingBox            = this.ProductInShippingBox;
            state.ProductDefaultShipmentBoxTypeId = this.ProductDefaultShipmentBoxTypeId;
            if (this.ProductIsSerialNumbered != null && this.ProductIsSerialNumbered.HasValue)
            {
                state.ProductIsSerialNumbered = this.ProductIsSerialNumbered.Value;
            }
            if (this.ProductIsManagedByLot != null && this.ProductIsManagedByLot.HasValue)
            {
                state.ProductIsManagedByLot = this.ProductIsManagedByLot.Value;
            }
            state.ProductAttributeSetId         = this.ProductAttributeSetId;
            state.ProductAttributeSetInstanceId = this.ProductAttributeSetInstanceId;
            state.ProductCreatedBy = this.ProductCreatedBy;
            if (this.ProductCreatedAt != null && this.ProductCreatedAt.HasValue)
            {
                state.ProductCreatedAt = this.ProductCreatedAt.Value;
            }
            state.ProductUpdatedBy = this.ProductUpdatedBy;
            if (this.ProductUpdatedAt != null && this.ProductUpdatedAt.HasValue)
            {
                state.ProductUpdatedAt = this.ProductUpdatedAt.Value;
            }
            if (this.ProductActive != null && this.ProductActive.HasValue)
            {
                state.ProductActive = this.ProductActive.Value;
            }
            if (this.ProductVersion != null && this.ProductVersion.HasValue)
            {
                state.ProductVersion = this.ProductVersion.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);
        }
예제 #3
0
 public static CreateGoodIdentificationMvo ToCreateGoodIdentificationMvo(this GoodIdentificationMvoState state)
 {
     return(state.ToCreateGoodIdentificationMvo <CreateGoodIdentificationMvo>());
 }
예제 #4
0
 public static MergePatchGoodIdentificationMvo ToMergePatchGoodIdentificationMvo(this GoodIdentificationMvoState state)
 {
     return(state.ToMergePatchGoodIdentificationMvo <MergePatchGoodIdentificationMvo>());
 }
예제 #5
0
 public static DeleteGoodIdentificationMvo ToDeleteGoodIdentificationMvo(this GoodIdentificationMvoState state)
 {
     return(state.ToDeleteGoodIdentificationMvo <DeleteGoodIdentificationMvo>());
 }
예제 #6
0
 public static IGoodIdentificationMvoCommand ToCreateOrMergePatchGoodIdentificationMvo(this GoodIdentificationMvoState state)
 {
     return(state.ToCreateOrMergePatchGoodIdentificationMvo <CreateGoodIdentificationMvo, MergePatchGoodIdentificationMvo>());
 }