public virtual GoodIdentificationMvoStateMergePatchedDto ToGoodIdentificationMvoStateMergePatchedDto(IGoodIdentificationMvoStateMergePatched e)
        {
            var dto = new GoodIdentificationMvoStateMergePatchedDto();

            dto.GoodIdentificationMvoEventId = e.GoodIdentificationMvoEventId;
            dto.CreatedAt                                          = e.CreatedAt;
            dto.CreatedBy                                          = e.CreatedBy;
            dto.CommandId                                          = e.CommandId;
            dto.IdValue                                            = e.IdValue;
            dto.Version                                            = e.Version;
            dto.Active                                             = e.Active;
            dto.ProductProductTypeId                               = e.ProductProductTypeId;
            dto.ProductPrimaryProductCategoryId                    = e.ProductPrimaryProductCategoryId;
            dto.ProductManufacturerPartyId                         = e.ProductManufacturerPartyId;
            dto.ProductFacilityId                                  = e.ProductFacilityId;
            dto.ProductIntroductionDate                            = e.ProductIntroductionDate;
            dto.ProductReleaseDate                                 = e.ProductReleaseDate;
            dto.ProductSupportDiscontinuationDate                  = e.ProductSupportDiscontinuationDate;
            dto.ProductSalesDiscontinuationDate                    = e.ProductSalesDiscontinuationDate;
            dto.ProductSalesDiscWhenNotAvail                       = e.ProductSalesDiscWhenNotAvail;
            dto.ProductInternalName                                = e.ProductInternalName;
            dto.ProductBrandName                                   = e.ProductBrandName;
            dto.ProductComments                                    = e.ProductComments;
            dto.ProductProductName                                 = e.ProductProductName;
            dto.ProductDescription                                 = e.ProductDescription;
            dto.ProductPriceDetailText                             = e.ProductPriceDetailText;
            dto.ProductSmallImageUrl                               = e.ProductSmallImageUrl;
            dto.ProductMediumImageUrl                              = e.ProductMediumImageUrl;
            dto.ProductLargeImageUrl                               = e.ProductLargeImageUrl;
            dto.ProductDetailImageUrl                              = e.ProductDetailImageUrl;
            dto.ProductOriginalImageUrl                            = e.ProductOriginalImageUrl;
            dto.ProductDetailScreen                                = e.ProductDetailScreen;
            dto.ProductInventoryMessage                            = e.ProductInventoryMessage;
            dto.ProductInventoryItemTypeId                         = e.ProductInventoryItemTypeId;
            dto.ProductRequireInventory                            = e.ProductRequireInventory;
            dto.ProductQuantityUomId                               = e.ProductQuantityUomId;
            dto.ProductQuantityIncluded                            = e.ProductQuantityIncluded;
            dto.ProductPiecesIncluded                              = e.ProductPiecesIncluded;
            dto.ProductRequireAmount                               = e.ProductRequireAmount;
            dto.ProductFixedAmount                                 = e.ProductFixedAmount;
            dto.ProductAmountUomTypeId                             = e.ProductAmountUomTypeId;
            dto.ProductWeightUomId                                 = e.ProductWeightUomId;
            dto.ProductShippingWeight                              = e.ProductShippingWeight;
            dto.ProductProductWeight                               = e.ProductProductWeight;
            dto.ProductHeightUomId                                 = e.ProductHeightUomId;
            dto.ProductProductHeight                               = e.ProductProductHeight;
            dto.ProductShippingHeight                              = e.ProductShippingHeight;
            dto.ProductWidthUomId                                  = e.ProductWidthUomId;
            dto.ProductProductWidth                                = e.ProductProductWidth;
            dto.ProductShippingWidth                               = e.ProductShippingWidth;
            dto.ProductDepthUomId                                  = e.ProductDepthUomId;
            dto.ProductProductDepth                                = e.ProductProductDepth;
            dto.ProductShippingDepth                               = e.ProductShippingDepth;
            dto.ProductDiameterUomId                               = e.ProductDiameterUomId;
            dto.ProductProductDiameter                             = e.ProductProductDiameter;
            dto.ProductProductRating                               = e.ProductProductRating;
            dto.ProductRatingTypeEnum                              = e.ProductRatingTypeEnum;
            dto.ProductReturnable                                  = e.ProductReturnable;
            dto.ProductTaxable                                     = e.ProductTaxable;
            dto.ProductChargeShipping                              = e.ProductChargeShipping;
            dto.ProductAutoCreateKeywords                          = e.ProductAutoCreateKeywords;
            dto.ProductIncludeInPromotions                         = e.ProductIncludeInPromotions;
            dto.ProductIsVirtual                                   = e.ProductIsVirtual;
            dto.ProductIsVariant                                   = e.ProductIsVariant;
            dto.ProductVirtualVariantMethodEnum                    = e.ProductVirtualVariantMethodEnum;
            dto.ProductInShippingBox                               = e.ProductInShippingBox;
            dto.ProductDefaultShipmentBoxTypeId                    = e.ProductDefaultShipmentBoxTypeId;
            dto.ProductIsSerialNumbered                            = e.ProductIsSerialNumbered;
            dto.ProductIsManagedByLot                              = e.ProductIsManagedByLot;
            dto.ProductAttributeSetId                              = e.ProductAttributeSetId;
            dto.ProductAttributeSetInstanceId                      = e.ProductAttributeSetInstanceId;
            dto.ProductCreatedBy                                   = e.ProductCreatedBy;
            dto.ProductCreatedAt                                   = e.ProductCreatedAt;
            dto.ProductUpdatedBy                                   = e.ProductUpdatedBy;
            dto.ProductUpdatedAt                                   = e.ProductUpdatedAt;
            dto.ProductActive                                      = e.ProductActive;
            dto.IsPropertyIdValueRemoved                           = e.IsPropertyIdValueRemoved;
            dto.IsPropertyVersionRemoved                           = e.IsPropertyVersionRemoved;
            dto.IsPropertyActiveRemoved                            = e.IsPropertyActiveRemoved;
            dto.IsPropertyProductProductTypeIdRemoved              = e.IsPropertyProductProductTypeIdRemoved;
            dto.IsPropertyProductPrimaryProductCategoryIdRemoved   = e.IsPropertyProductPrimaryProductCategoryIdRemoved;
            dto.IsPropertyProductManufacturerPartyIdRemoved        = e.IsPropertyProductManufacturerPartyIdRemoved;
            dto.IsPropertyProductFacilityIdRemoved                 = e.IsPropertyProductFacilityIdRemoved;
            dto.IsPropertyProductIntroductionDateRemoved           = e.IsPropertyProductIntroductionDateRemoved;
            dto.IsPropertyProductReleaseDateRemoved                = e.IsPropertyProductReleaseDateRemoved;
            dto.IsPropertyProductSupportDiscontinuationDateRemoved = e.IsPropertyProductSupportDiscontinuationDateRemoved;
            dto.IsPropertyProductSalesDiscontinuationDateRemoved   = e.IsPropertyProductSalesDiscontinuationDateRemoved;
            dto.IsPropertyProductSalesDiscWhenNotAvailRemoved      = e.IsPropertyProductSalesDiscWhenNotAvailRemoved;
            dto.IsPropertyProductInternalNameRemoved               = e.IsPropertyProductInternalNameRemoved;
            dto.IsPropertyProductBrandNameRemoved                  = e.IsPropertyProductBrandNameRemoved;
            dto.IsPropertyProductCommentsRemoved                   = e.IsPropertyProductCommentsRemoved;
            dto.IsPropertyProductProductNameRemoved                = e.IsPropertyProductProductNameRemoved;
            dto.IsPropertyProductDescriptionRemoved                = e.IsPropertyProductDescriptionRemoved;
            dto.IsPropertyProductPriceDetailTextRemoved            = e.IsPropertyProductPriceDetailTextRemoved;
            dto.IsPropertyProductSmallImageUrlRemoved              = e.IsPropertyProductSmallImageUrlRemoved;
            dto.IsPropertyProductMediumImageUrlRemoved             = e.IsPropertyProductMediumImageUrlRemoved;
            dto.IsPropertyProductLargeImageUrlRemoved              = e.IsPropertyProductLargeImageUrlRemoved;
            dto.IsPropertyProductDetailImageUrlRemoved             = e.IsPropertyProductDetailImageUrlRemoved;
            dto.IsPropertyProductOriginalImageUrlRemoved           = e.IsPropertyProductOriginalImageUrlRemoved;
            dto.IsPropertyProductDetailScreenRemoved               = e.IsPropertyProductDetailScreenRemoved;
            dto.IsPropertyProductInventoryMessageRemoved           = e.IsPropertyProductInventoryMessageRemoved;
            dto.IsPropertyProductInventoryItemTypeIdRemoved        = e.IsPropertyProductInventoryItemTypeIdRemoved;
            dto.IsPropertyProductRequireInventoryRemoved           = e.IsPropertyProductRequireInventoryRemoved;
            dto.IsPropertyProductQuantityUomIdRemoved              = e.IsPropertyProductQuantityUomIdRemoved;
            dto.IsPropertyProductQuantityIncludedRemoved           = e.IsPropertyProductQuantityIncludedRemoved;
            dto.IsPropertyProductPiecesIncludedRemoved             = e.IsPropertyProductPiecesIncludedRemoved;
            dto.IsPropertyProductRequireAmountRemoved              = e.IsPropertyProductRequireAmountRemoved;
            dto.IsPropertyProductFixedAmountRemoved                = e.IsPropertyProductFixedAmountRemoved;
            dto.IsPropertyProductAmountUomTypeIdRemoved            = e.IsPropertyProductAmountUomTypeIdRemoved;
            dto.IsPropertyProductWeightUomIdRemoved                = e.IsPropertyProductWeightUomIdRemoved;
            dto.IsPropertyProductShippingWeightRemoved             = e.IsPropertyProductShippingWeightRemoved;
            dto.IsPropertyProductProductWeightRemoved              = e.IsPropertyProductProductWeightRemoved;
            dto.IsPropertyProductHeightUomIdRemoved                = e.IsPropertyProductHeightUomIdRemoved;
            dto.IsPropertyProductProductHeightRemoved              = e.IsPropertyProductProductHeightRemoved;
            dto.IsPropertyProductShippingHeightRemoved             = e.IsPropertyProductShippingHeightRemoved;
            dto.IsPropertyProductWidthUomIdRemoved                 = e.IsPropertyProductWidthUomIdRemoved;
            dto.IsPropertyProductProductWidthRemoved               = e.IsPropertyProductProductWidthRemoved;
            dto.IsPropertyProductShippingWidthRemoved              = e.IsPropertyProductShippingWidthRemoved;
            dto.IsPropertyProductDepthUomIdRemoved                 = e.IsPropertyProductDepthUomIdRemoved;
            dto.IsPropertyProductProductDepthRemoved               = e.IsPropertyProductProductDepthRemoved;
            dto.IsPropertyProductShippingDepthRemoved              = e.IsPropertyProductShippingDepthRemoved;
            dto.IsPropertyProductDiameterUomIdRemoved              = e.IsPropertyProductDiameterUomIdRemoved;
            dto.IsPropertyProductProductDiameterRemoved            = e.IsPropertyProductProductDiameterRemoved;
            dto.IsPropertyProductProductRatingRemoved              = e.IsPropertyProductProductRatingRemoved;
            dto.IsPropertyProductRatingTypeEnumRemoved             = e.IsPropertyProductRatingTypeEnumRemoved;
            dto.IsPropertyProductReturnableRemoved                 = e.IsPropertyProductReturnableRemoved;
            dto.IsPropertyProductTaxableRemoved                    = e.IsPropertyProductTaxableRemoved;
            dto.IsPropertyProductChargeShippingRemoved             = e.IsPropertyProductChargeShippingRemoved;
            dto.IsPropertyProductAutoCreateKeywordsRemoved         = e.IsPropertyProductAutoCreateKeywordsRemoved;
            dto.IsPropertyProductIncludeInPromotionsRemoved        = e.IsPropertyProductIncludeInPromotionsRemoved;
            dto.IsPropertyProductIsVirtualRemoved                  = e.IsPropertyProductIsVirtualRemoved;
            dto.IsPropertyProductIsVariantRemoved                  = e.IsPropertyProductIsVariantRemoved;
            dto.IsPropertyProductVirtualVariantMethodEnumRemoved   = e.IsPropertyProductVirtualVariantMethodEnumRemoved;
            dto.IsPropertyProductInShippingBoxRemoved              = e.IsPropertyProductInShippingBoxRemoved;
            dto.IsPropertyProductDefaultShipmentBoxTypeIdRemoved   = e.IsPropertyProductDefaultShipmentBoxTypeIdRemoved;
            dto.IsPropertyProductIsSerialNumberedRemoved           = e.IsPropertyProductIsSerialNumberedRemoved;
            dto.IsPropertyProductIsManagedByLotRemoved             = e.IsPropertyProductIsManagedByLotRemoved;
            dto.IsPropertyProductAttributeSetIdRemoved             = e.IsPropertyProductAttributeSetIdRemoved;
            dto.IsPropertyProductAttributeSetInstanceIdRemoved     = e.IsPropertyProductAttributeSetInstanceIdRemoved;
            dto.IsPropertyProductCreatedByRemoved                  = e.IsPropertyProductCreatedByRemoved;
            dto.IsPropertyProductCreatedAtRemoved                  = e.IsPropertyProductCreatedAtRemoved;
            dto.IsPropertyProductUpdatedByRemoved                  = e.IsPropertyProductUpdatedByRemoved;
            dto.IsPropertyProductUpdatedAtRemoved                  = e.IsPropertyProductUpdatedAtRemoved;
            dto.IsPropertyProductActiveRemoved                     = e.IsPropertyProductActiveRemoved;

            return(dto);
        }
        public virtual void MergePatch(IMergePatchGoodIdentificationMvo c)
        {
            IGoodIdentificationMvoStateMergePatched e = Map(c);

            Apply(e);
        }
        public virtual void When(IGoodIdentificationMvoStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.IdValue == null)
            {
                if (e.IsPropertyIdValueRemoved)
                {
                    this.IdValue = default(string);
                }
            }
            else
            {
                this.IdValue = e.IdValue;
            }

            if (e.Version == null)
            {
                if (e.IsPropertyVersionRemoved)
                {
                    this.Version = default(long);
                }
            }
            else
            {
                this.Version = (e.Version != null && e.Version.HasValue) ? e.Version.Value : default(long);
            }

            if (e.Active == null)
            {
                if (e.IsPropertyActiveRemoved)
                {
                    this.Active = default(bool);
                }
            }
            else
            {
                this.Active = (e.Active != null && e.Active.HasValue) ? e.Active.Value : default(bool);
            }

            if (e.ProductProductTypeId == null)
            {
                if (e.IsPropertyProductProductTypeIdRemoved)
                {
                    this.ProductProductTypeId = default(string);
                }
            }
            else
            {
                this.ProductProductTypeId = e.ProductProductTypeId;
            }

            if (e.ProductPrimaryProductCategoryId == null)
            {
                if (e.IsPropertyProductPrimaryProductCategoryIdRemoved)
                {
                    this.ProductPrimaryProductCategoryId = default(string);
                }
            }
            else
            {
                this.ProductPrimaryProductCategoryId = e.ProductPrimaryProductCategoryId;
            }

            if (e.ProductManufacturerPartyId == null)
            {
                if (e.IsPropertyProductManufacturerPartyIdRemoved)
                {
                    this.ProductManufacturerPartyId = default(string);
                }
            }
            else
            {
                this.ProductManufacturerPartyId = e.ProductManufacturerPartyId;
            }

            if (e.ProductFacilityId == null)
            {
                if (e.IsPropertyProductFacilityIdRemoved)
                {
                    this.ProductFacilityId = default(string);
                }
            }
            else
            {
                this.ProductFacilityId = e.ProductFacilityId;
            }

            if (e.ProductIntroductionDate == null)
            {
                if (e.IsPropertyProductIntroductionDateRemoved)
                {
                    this.ProductIntroductionDate = default(DateTime?);
                }
            }
            else
            {
                this.ProductIntroductionDate = e.ProductIntroductionDate;
            }

            if (e.ProductReleaseDate == null)
            {
                if (e.IsPropertyProductReleaseDateRemoved)
                {
                    this.ProductReleaseDate = default(DateTime?);
                }
            }
            else
            {
                this.ProductReleaseDate = e.ProductReleaseDate;
            }

            if (e.ProductSupportDiscontinuationDate == null)
            {
                if (e.IsPropertyProductSupportDiscontinuationDateRemoved)
                {
                    this.ProductSupportDiscontinuationDate = default(DateTime?);
                }
            }
            else
            {
                this.ProductSupportDiscontinuationDate = e.ProductSupportDiscontinuationDate;
            }

            if (e.ProductSalesDiscontinuationDate == null)
            {
                if (e.IsPropertyProductSalesDiscontinuationDateRemoved)
                {
                    this.ProductSalesDiscontinuationDate = default(DateTime?);
                }
            }
            else
            {
                this.ProductSalesDiscontinuationDate = e.ProductSalesDiscontinuationDate;
            }

            if (e.ProductSalesDiscWhenNotAvail == null)
            {
                if (e.IsPropertyProductSalesDiscWhenNotAvailRemoved)
                {
                    this.ProductSalesDiscWhenNotAvail = default(string);
                }
            }
            else
            {
                this.ProductSalesDiscWhenNotAvail = e.ProductSalesDiscWhenNotAvail;
            }

            if (e.ProductInternalName == null)
            {
                if (e.IsPropertyProductInternalNameRemoved)
                {
                    this.ProductInternalName = default(string);
                }
            }
            else
            {
                this.ProductInternalName = e.ProductInternalName;
            }

            if (e.ProductBrandName == null)
            {
                if (e.IsPropertyProductBrandNameRemoved)
                {
                    this.ProductBrandName = default(string);
                }
            }
            else
            {
                this.ProductBrandName = e.ProductBrandName;
            }

            if (e.ProductComments == null)
            {
                if (e.IsPropertyProductCommentsRemoved)
                {
                    this.ProductComments = default(string);
                }
            }
            else
            {
                this.ProductComments = e.ProductComments;
            }

            if (e.ProductProductName == null)
            {
                if (e.IsPropertyProductProductNameRemoved)
                {
                    this.ProductProductName = default(string);
                }
            }
            else
            {
                this.ProductProductName = e.ProductProductName;
            }

            if (e.ProductDescription == null)
            {
                if (e.IsPropertyProductDescriptionRemoved)
                {
                    this.ProductDescription = default(string);
                }
            }
            else
            {
                this.ProductDescription = e.ProductDescription;
            }

            if (e.ProductPriceDetailText == null)
            {
                if (e.IsPropertyProductPriceDetailTextRemoved)
                {
                    this.ProductPriceDetailText = default(string);
                }
            }
            else
            {
                this.ProductPriceDetailText = e.ProductPriceDetailText;
            }

            if (e.ProductSmallImageUrl == null)
            {
                if (e.IsPropertyProductSmallImageUrlRemoved)
                {
                    this.ProductSmallImageUrl = default(string);
                }
            }
            else
            {
                this.ProductSmallImageUrl = e.ProductSmallImageUrl;
            }

            if (e.ProductMediumImageUrl == null)
            {
                if (e.IsPropertyProductMediumImageUrlRemoved)
                {
                    this.ProductMediumImageUrl = default(string);
                }
            }
            else
            {
                this.ProductMediumImageUrl = e.ProductMediumImageUrl;
            }

            if (e.ProductLargeImageUrl == null)
            {
                if (e.IsPropertyProductLargeImageUrlRemoved)
                {
                    this.ProductLargeImageUrl = default(string);
                }
            }
            else
            {
                this.ProductLargeImageUrl = e.ProductLargeImageUrl;
            }

            if (e.ProductDetailImageUrl == null)
            {
                if (e.IsPropertyProductDetailImageUrlRemoved)
                {
                    this.ProductDetailImageUrl = default(string);
                }
            }
            else
            {
                this.ProductDetailImageUrl = e.ProductDetailImageUrl;
            }

            if (e.ProductOriginalImageUrl == null)
            {
                if (e.IsPropertyProductOriginalImageUrlRemoved)
                {
                    this.ProductOriginalImageUrl = default(string);
                }
            }
            else
            {
                this.ProductOriginalImageUrl = e.ProductOriginalImageUrl;
            }

            if (e.ProductDetailScreen == null)
            {
                if (e.IsPropertyProductDetailScreenRemoved)
                {
                    this.ProductDetailScreen = default(string);
                }
            }
            else
            {
                this.ProductDetailScreen = e.ProductDetailScreen;
            }

            if (e.ProductInventoryMessage == null)
            {
                if (e.IsPropertyProductInventoryMessageRemoved)
                {
                    this.ProductInventoryMessage = default(string);
                }
            }
            else
            {
                this.ProductInventoryMessage = e.ProductInventoryMessage;
            }

            if (e.ProductInventoryItemTypeId == null)
            {
                if (e.IsPropertyProductInventoryItemTypeIdRemoved)
                {
                    this.ProductInventoryItemTypeId = default(string);
                }
            }
            else
            {
                this.ProductInventoryItemTypeId = e.ProductInventoryItemTypeId;
            }

            if (e.ProductRequireInventory == null)
            {
                if (e.IsPropertyProductRequireInventoryRemoved)
                {
                    this.ProductRequireInventory = default(string);
                }
            }
            else
            {
                this.ProductRequireInventory = e.ProductRequireInventory;
            }

            if (e.ProductQuantityUomId == null)
            {
                if (e.IsPropertyProductQuantityUomIdRemoved)
                {
                    this.ProductQuantityUomId = default(string);
                }
            }
            else
            {
                this.ProductQuantityUomId = e.ProductQuantityUomId;
            }

            if (e.ProductQuantityIncluded == null)
            {
                if (e.IsPropertyProductQuantityIncludedRemoved)
                {
                    this.ProductQuantityIncluded = default(decimal?);
                }
            }
            else
            {
                this.ProductQuantityIncluded = e.ProductQuantityIncluded;
            }

            if (e.ProductPiecesIncluded == null)
            {
                if (e.IsPropertyProductPiecesIncludedRemoved)
                {
                    this.ProductPiecesIncluded = default(long?);
                }
            }
            else
            {
                this.ProductPiecesIncluded = e.ProductPiecesIncluded;
            }

            if (e.ProductRequireAmount == null)
            {
                if (e.IsPropertyProductRequireAmountRemoved)
                {
                    this.ProductRequireAmount = default(string);
                }
            }
            else
            {
                this.ProductRequireAmount = e.ProductRequireAmount;
            }

            if (e.ProductFixedAmount == null)
            {
                if (e.IsPropertyProductFixedAmountRemoved)
                {
                    this.ProductFixedAmount = default(decimal?);
                }
            }
            else
            {
                this.ProductFixedAmount = e.ProductFixedAmount;
            }

            if (e.ProductAmountUomTypeId == null)
            {
                if (e.IsPropertyProductAmountUomTypeIdRemoved)
                {
                    this.ProductAmountUomTypeId = default(string);
                }
            }
            else
            {
                this.ProductAmountUomTypeId = e.ProductAmountUomTypeId;
            }

            if (e.ProductWeightUomId == null)
            {
                if (e.IsPropertyProductWeightUomIdRemoved)
                {
                    this.ProductWeightUomId = default(string);
                }
            }
            else
            {
                this.ProductWeightUomId = e.ProductWeightUomId;
            }

            if (e.ProductShippingWeight == null)
            {
                if (e.IsPropertyProductShippingWeightRemoved)
                {
                    this.ProductShippingWeight = default(decimal?);
                }
            }
            else
            {
                this.ProductShippingWeight = e.ProductShippingWeight;
            }

            if (e.ProductProductWeight == null)
            {
                if (e.IsPropertyProductProductWeightRemoved)
                {
                    this.ProductProductWeight = default(decimal?);
                }
            }
            else
            {
                this.ProductProductWeight = e.ProductProductWeight;
            }

            if (e.ProductHeightUomId == null)
            {
                if (e.IsPropertyProductHeightUomIdRemoved)
                {
                    this.ProductHeightUomId = default(string);
                }
            }
            else
            {
                this.ProductHeightUomId = e.ProductHeightUomId;
            }

            if (e.ProductProductHeight == null)
            {
                if (e.IsPropertyProductProductHeightRemoved)
                {
                    this.ProductProductHeight = default(decimal?);
                }
            }
            else
            {
                this.ProductProductHeight = e.ProductProductHeight;
            }

            if (e.ProductShippingHeight == null)
            {
                if (e.IsPropertyProductShippingHeightRemoved)
                {
                    this.ProductShippingHeight = default(decimal?);
                }
            }
            else
            {
                this.ProductShippingHeight = e.ProductShippingHeight;
            }

            if (e.ProductWidthUomId == null)
            {
                if (e.IsPropertyProductWidthUomIdRemoved)
                {
                    this.ProductWidthUomId = default(string);
                }
            }
            else
            {
                this.ProductWidthUomId = e.ProductWidthUomId;
            }

            if (e.ProductProductWidth == null)
            {
                if (e.IsPropertyProductProductWidthRemoved)
                {
                    this.ProductProductWidth = default(decimal?);
                }
            }
            else
            {
                this.ProductProductWidth = e.ProductProductWidth;
            }

            if (e.ProductShippingWidth == null)
            {
                if (e.IsPropertyProductShippingWidthRemoved)
                {
                    this.ProductShippingWidth = default(decimal?);
                }
            }
            else
            {
                this.ProductShippingWidth = e.ProductShippingWidth;
            }

            if (e.ProductDepthUomId == null)
            {
                if (e.IsPropertyProductDepthUomIdRemoved)
                {
                    this.ProductDepthUomId = default(string);
                }
            }
            else
            {
                this.ProductDepthUomId = e.ProductDepthUomId;
            }

            if (e.ProductProductDepth == null)
            {
                if (e.IsPropertyProductProductDepthRemoved)
                {
                    this.ProductProductDepth = default(decimal?);
                }
            }
            else
            {
                this.ProductProductDepth = e.ProductProductDepth;
            }

            if (e.ProductShippingDepth == null)
            {
                if (e.IsPropertyProductShippingDepthRemoved)
                {
                    this.ProductShippingDepth = default(decimal?);
                }
            }
            else
            {
                this.ProductShippingDepth = e.ProductShippingDepth;
            }

            if (e.ProductDiameterUomId == null)
            {
                if (e.IsPropertyProductDiameterUomIdRemoved)
                {
                    this.ProductDiameterUomId = default(string);
                }
            }
            else
            {
                this.ProductDiameterUomId = e.ProductDiameterUomId;
            }

            if (e.ProductProductDiameter == null)
            {
                if (e.IsPropertyProductProductDiameterRemoved)
                {
                    this.ProductProductDiameter = default(decimal?);
                }
            }
            else
            {
                this.ProductProductDiameter = e.ProductProductDiameter;
            }

            if (e.ProductProductRating == null)
            {
                if (e.IsPropertyProductProductRatingRemoved)
                {
                    this.ProductProductRating = default(decimal?);
                }
            }
            else
            {
                this.ProductProductRating = e.ProductProductRating;
            }

            if (e.ProductRatingTypeEnum == null)
            {
                if (e.IsPropertyProductRatingTypeEnumRemoved)
                {
                    this.ProductRatingTypeEnum = default(string);
                }
            }
            else
            {
                this.ProductRatingTypeEnum = e.ProductRatingTypeEnum;
            }

            if (e.ProductReturnable == null)
            {
                if (e.IsPropertyProductReturnableRemoved)
                {
                    this.ProductReturnable = default(string);
                }
            }
            else
            {
                this.ProductReturnable = e.ProductReturnable;
            }

            if (e.ProductTaxable == null)
            {
                if (e.IsPropertyProductTaxableRemoved)
                {
                    this.ProductTaxable = default(string);
                }
            }
            else
            {
                this.ProductTaxable = e.ProductTaxable;
            }

            if (e.ProductChargeShipping == null)
            {
                if (e.IsPropertyProductChargeShippingRemoved)
                {
                    this.ProductChargeShipping = default(string);
                }
            }
            else
            {
                this.ProductChargeShipping = e.ProductChargeShipping;
            }

            if (e.ProductAutoCreateKeywords == null)
            {
                if (e.IsPropertyProductAutoCreateKeywordsRemoved)
                {
                    this.ProductAutoCreateKeywords = default(string);
                }
            }
            else
            {
                this.ProductAutoCreateKeywords = e.ProductAutoCreateKeywords;
            }

            if (e.ProductIncludeInPromotions == null)
            {
                if (e.IsPropertyProductIncludeInPromotionsRemoved)
                {
                    this.ProductIncludeInPromotions = default(string);
                }
            }
            else
            {
                this.ProductIncludeInPromotions = e.ProductIncludeInPromotions;
            }

            if (e.ProductIsVirtual == null)
            {
                if (e.IsPropertyProductIsVirtualRemoved)
                {
                    this.ProductIsVirtual = default(string);
                }
            }
            else
            {
                this.ProductIsVirtual = e.ProductIsVirtual;
            }

            if (e.ProductIsVariant == null)
            {
                if (e.IsPropertyProductIsVariantRemoved)
                {
                    this.ProductIsVariant = default(string);
                }
            }
            else
            {
                this.ProductIsVariant = e.ProductIsVariant;
            }

            if (e.ProductVirtualVariantMethodEnum == null)
            {
                if (e.IsPropertyProductVirtualVariantMethodEnumRemoved)
                {
                    this.ProductVirtualVariantMethodEnum = default(string);
                }
            }
            else
            {
                this.ProductVirtualVariantMethodEnum = e.ProductVirtualVariantMethodEnum;
            }

            if (e.ProductInShippingBox == null)
            {
                if (e.IsPropertyProductInShippingBoxRemoved)
                {
                    this.ProductInShippingBox = default(string);
                }
            }
            else
            {
                this.ProductInShippingBox = e.ProductInShippingBox;
            }

            if (e.ProductDefaultShipmentBoxTypeId == null)
            {
                if (e.IsPropertyProductDefaultShipmentBoxTypeIdRemoved)
                {
                    this.ProductDefaultShipmentBoxTypeId = default(string);
                }
            }
            else
            {
                this.ProductDefaultShipmentBoxTypeId = e.ProductDefaultShipmentBoxTypeId;
            }

            if (e.ProductIsSerialNumbered == null)
            {
                if (e.IsPropertyProductIsSerialNumberedRemoved)
                {
                    this.ProductIsSerialNumbered = default(bool);
                }
            }
            else
            {
                this.ProductIsSerialNumbered = (e.ProductIsSerialNumbered != null && e.ProductIsSerialNumbered.HasValue) ? e.ProductIsSerialNumbered.Value : default(bool);
            }

            if (e.ProductIsManagedByLot == null)
            {
                if (e.IsPropertyProductIsManagedByLotRemoved)
                {
                    this.ProductIsManagedByLot = default(bool);
                }
            }
            else
            {
                this.ProductIsManagedByLot = (e.ProductIsManagedByLot != null && e.ProductIsManagedByLot.HasValue) ? e.ProductIsManagedByLot.Value : default(bool);
            }

            if (e.ProductAttributeSetId == null)
            {
                if (e.IsPropertyProductAttributeSetIdRemoved)
                {
                    this.ProductAttributeSetId = default(string);
                }
            }
            else
            {
                this.ProductAttributeSetId = e.ProductAttributeSetId;
            }

            if (e.ProductAttributeSetInstanceId == null)
            {
                if (e.IsPropertyProductAttributeSetInstanceIdRemoved)
                {
                    this.ProductAttributeSetInstanceId = default(string);
                }
            }
            else
            {
                this.ProductAttributeSetInstanceId = e.ProductAttributeSetInstanceId;
            }

            if (e.ProductCreatedBy == null)
            {
                if (e.IsPropertyProductCreatedByRemoved)
                {
                    this.ProductCreatedBy = default(string);
                }
            }
            else
            {
                this.ProductCreatedBy = e.ProductCreatedBy;
            }

            if (e.ProductCreatedAt == null)
            {
                if (e.IsPropertyProductCreatedAtRemoved)
                {
                    this.ProductCreatedAt = default(DateTime);
                }
            }
            else
            {
                this.ProductCreatedAt = (e.ProductCreatedAt != null && e.ProductCreatedAt.HasValue) ? e.ProductCreatedAt.Value : default(DateTime);
            }

            if (e.ProductUpdatedBy == null)
            {
                if (e.IsPropertyProductUpdatedByRemoved)
                {
                    this.ProductUpdatedBy = default(string);
                }
            }
            else
            {
                this.ProductUpdatedBy = e.ProductUpdatedBy;
            }

            if (e.ProductUpdatedAt == null)
            {
                if (e.IsPropertyProductUpdatedAtRemoved)
                {
                    this.ProductUpdatedAt = default(DateTime);
                }
            }
            else
            {
                this.ProductUpdatedAt = (e.ProductUpdatedAt != null && e.ProductUpdatedAt.HasValue) ? e.ProductUpdatedAt.Value : default(DateTime);
            }

            if (e.ProductActive == null)
            {
                if (e.IsPropertyProductActiveRemoved)
                {
                    this.ProductActive = default(bool);
                }
            }
            else
            {
                this.ProductActive = (e.ProductActive != null && e.ProductActive.HasValue) ? e.ProductActive.Value : default(bool);
            }


            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
        protected virtual IGoodIdentificationMvoStateMergePatched Map(IMergePatchGoodIdentificationMvo c)
        {
            var stateEventId = new GoodIdentificationMvoEventId(c.ProductGoodIdentificationId, c.ProductVersion);
            IGoodIdentificationMvoStateMergePatched e = NewGoodIdentificationMvoStateMergePatched(stateEventId);

            e.IdValue = c.IdValue;
            e.Version = c.Version;
            e.Active  = c.Active;
            e.ProductProductTypeId            = c.ProductProductTypeId;
            e.ProductPrimaryProductCategoryId = c.ProductPrimaryProductCategoryId;
            e.ProductManufacturerPartyId      = c.ProductManufacturerPartyId;
            e.ProductFacilityId                 = c.ProductFacilityId;
            e.ProductIntroductionDate           = c.ProductIntroductionDate;
            e.ProductReleaseDate                = c.ProductReleaseDate;
            e.ProductSupportDiscontinuationDate = c.ProductSupportDiscontinuationDate;
            e.ProductSalesDiscontinuationDate   = c.ProductSalesDiscontinuationDate;
            e.ProductSalesDiscWhenNotAvail      = c.ProductSalesDiscWhenNotAvail;
            e.ProductInternalName               = c.ProductInternalName;
            e.ProductBrandName                = c.ProductBrandName;
            e.ProductComments                 = c.ProductComments;
            e.ProductProductName              = c.ProductProductName;
            e.ProductDescription              = c.ProductDescription;
            e.ProductPriceDetailText          = c.ProductPriceDetailText;
            e.ProductSmallImageUrl            = c.ProductSmallImageUrl;
            e.ProductMediumImageUrl           = c.ProductMediumImageUrl;
            e.ProductLargeImageUrl            = c.ProductLargeImageUrl;
            e.ProductDetailImageUrl           = c.ProductDetailImageUrl;
            e.ProductOriginalImageUrl         = c.ProductOriginalImageUrl;
            e.ProductDetailScreen             = c.ProductDetailScreen;
            e.ProductInventoryMessage         = c.ProductInventoryMessage;
            e.ProductInventoryItemTypeId      = c.ProductInventoryItemTypeId;
            e.ProductRequireInventory         = c.ProductRequireInventory;
            e.ProductQuantityUomId            = c.ProductQuantityUomId;
            e.ProductQuantityIncluded         = c.ProductQuantityIncluded;
            e.ProductPiecesIncluded           = c.ProductPiecesIncluded;
            e.ProductRequireAmount            = c.ProductRequireAmount;
            e.ProductFixedAmount              = c.ProductFixedAmount;
            e.ProductAmountUomTypeId          = c.ProductAmountUomTypeId;
            e.ProductWeightUomId              = c.ProductWeightUomId;
            e.ProductShippingWeight           = c.ProductShippingWeight;
            e.ProductProductWeight            = c.ProductProductWeight;
            e.ProductHeightUomId              = c.ProductHeightUomId;
            e.ProductProductHeight            = c.ProductProductHeight;
            e.ProductShippingHeight           = c.ProductShippingHeight;
            e.ProductWidthUomId               = c.ProductWidthUomId;
            e.ProductProductWidth             = c.ProductProductWidth;
            e.ProductShippingWidth            = c.ProductShippingWidth;
            e.ProductDepthUomId               = c.ProductDepthUomId;
            e.ProductProductDepth             = c.ProductProductDepth;
            e.ProductShippingDepth            = c.ProductShippingDepth;
            e.ProductDiameterUomId            = c.ProductDiameterUomId;
            e.ProductProductDiameter          = c.ProductProductDiameter;
            e.ProductProductRating            = c.ProductProductRating;
            e.ProductRatingTypeEnum           = c.ProductRatingTypeEnum;
            e.ProductReturnable               = c.ProductReturnable;
            e.ProductTaxable                  = c.ProductTaxable;
            e.ProductChargeShipping           = c.ProductChargeShipping;
            e.ProductAutoCreateKeywords       = c.ProductAutoCreateKeywords;
            e.ProductIncludeInPromotions      = c.ProductIncludeInPromotions;
            e.ProductIsVirtual                = c.ProductIsVirtual;
            e.ProductIsVariant                = c.ProductIsVariant;
            e.ProductVirtualVariantMethodEnum = c.ProductVirtualVariantMethodEnum;
            e.ProductInShippingBox            = c.ProductInShippingBox;
            e.ProductDefaultShipmentBoxTypeId = c.ProductDefaultShipmentBoxTypeId;
            e.ProductIsSerialNumbered         = c.ProductIsSerialNumbered;
            e.ProductIsManagedByLot           = c.ProductIsManagedByLot;
            e.ProductAttributeSetId           = c.ProductAttributeSetId;
            e.ProductAttributeSetInstanceId   = c.ProductAttributeSetInstanceId;
            e.ProductCreatedBy                = c.ProductCreatedBy;
            e.ProductCreatedAt                = c.ProductCreatedAt;
            e.ProductUpdatedBy                = c.ProductUpdatedBy;
            e.ProductUpdatedAt                = c.ProductUpdatedAt;
            e.ProductActive            = c.ProductActive;
            e.IsPropertyIdValueRemoved = c.IsPropertyIdValueRemoved;
            e.IsPropertyVersionRemoved = c.IsPropertyVersionRemoved;
            e.IsPropertyActiveRemoved  = c.IsPropertyActiveRemoved;
            e.IsPropertyProductProductTypeIdRemoved            = c.IsPropertyProductProductTypeIdRemoved;
            e.IsPropertyProductPrimaryProductCategoryIdRemoved = c.IsPropertyProductPrimaryProductCategoryIdRemoved;
            e.IsPropertyProductManufacturerPartyIdRemoved      = c.IsPropertyProductManufacturerPartyIdRemoved;
            e.IsPropertyProductFacilityIdRemoved                 = c.IsPropertyProductFacilityIdRemoved;
            e.IsPropertyProductIntroductionDateRemoved           = c.IsPropertyProductIntroductionDateRemoved;
            e.IsPropertyProductReleaseDateRemoved                = c.IsPropertyProductReleaseDateRemoved;
            e.IsPropertyProductSupportDiscontinuationDateRemoved = c.IsPropertyProductSupportDiscontinuationDateRemoved;
            e.IsPropertyProductSalesDiscontinuationDateRemoved   = c.IsPropertyProductSalesDiscontinuationDateRemoved;
            e.IsPropertyProductSalesDiscWhenNotAvailRemoved      = c.IsPropertyProductSalesDiscWhenNotAvailRemoved;
            e.IsPropertyProductInternalNameRemoved               = c.IsPropertyProductInternalNameRemoved;
            e.IsPropertyProductBrandNameRemoved                = c.IsPropertyProductBrandNameRemoved;
            e.IsPropertyProductCommentsRemoved                 = c.IsPropertyProductCommentsRemoved;
            e.IsPropertyProductProductNameRemoved              = c.IsPropertyProductProductNameRemoved;
            e.IsPropertyProductDescriptionRemoved              = c.IsPropertyProductDescriptionRemoved;
            e.IsPropertyProductPriceDetailTextRemoved          = c.IsPropertyProductPriceDetailTextRemoved;
            e.IsPropertyProductSmallImageUrlRemoved            = c.IsPropertyProductSmallImageUrlRemoved;
            e.IsPropertyProductMediumImageUrlRemoved           = c.IsPropertyProductMediumImageUrlRemoved;
            e.IsPropertyProductLargeImageUrlRemoved            = c.IsPropertyProductLargeImageUrlRemoved;
            e.IsPropertyProductDetailImageUrlRemoved           = c.IsPropertyProductDetailImageUrlRemoved;
            e.IsPropertyProductOriginalImageUrlRemoved         = c.IsPropertyProductOriginalImageUrlRemoved;
            e.IsPropertyProductDetailScreenRemoved             = c.IsPropertyProductDetailScreenRemoved;
            e.IsPropertyProductInventoryMessageRemoved         = c.IsPropertyProductInventoryMessageRemoved;
            e.IsPropertyProductInventoryItemTypeIdRemoved      = c.IsPropertyProductInventoryItemTypeIdRemoved;
            e.IsPropertyProductRequireInventoryRemoved         = c.IsPropertyProductRequireInventoryRemoved;
            e.IsPropertyProductQuantityUomIdRemoved            = c.IsPropertyProductQuantityUomIdRemoved;
            e.IsPropertyProductQuantityIncludedRemoved         = c.IsPropertyProductQuantityIncludedRemoved;
            e.IsPropertyProductPiecesIncludedRemoved           = c.IsPropertyProductPiecesIncludedRemoved;
            e.IsPropertyProductRequireAmountRemoved            = c.IsPropertyProductRequireAmountRemoved;
            e.IsPropertyProductFixedAmountRemoved              = c.IsPropertyProductFixedAmountRemoved;
            e.IsPropertyProductAmountUomTypeIdRemoved          = c.IsPropertyProductAmountUomTypeIdRemoved;
            e.IsPropertyProductWeightUomIdRemoved              = c.IsPropertyProductWeightUomIdRemoved;
            e.IsPropertyProductShippingWeightRemoved           = c.IsPropertyProductShippingWeightRemoved;
            e.IsPropertyProductProductWeightRemoved            = c.IsPropertyProductProductWeightRemoved;
            e.IsPropertyProductHeightUomIdRemoved              = c.IsPropertyProductHeightUomIdRemoved;
            e.IsPropertyProductProductHeightRemoved            = c.IsPropertyProductProductHeightRemoved;
            e.IsPropertyProductShippingHeightRemoved           = c.IsPropertyProductShippingHeightRemoved;
            e.IsPropertyProductWidthUomIdRemoved               = c.IsPropertyProductWidthUomIdRemoved;
            e.IsPropertyProductProductWidthRemoved             = c.IsPropertyProductProductWidthRemoved;
            e.IsPropertyProductShippingWidthRemoved            = c.IsPropertyProductShippingWidthRemoved;
            e.IsPropertyProductDepthUomIdRemoved               = c.IsPropertyProductDepthUomIdRemoved;
            e.IsPropertyProductProductDepthRemoved             = c.IsPropertyProductProductDepthRemoved;
            e.IsPropertyProductShippingDepthRemoved            = c.IsPropertyProductShippingDepthRemoved;
            e.IsPropertyProductDiameterUomIdRemoved            = c.IsPropertyProductDiameterUomIdRemoved;
            e.IsPropertyProductProductDiameterRemoved          = c.IsPropertyProductProductDiameterRemoved;
            e.IsPropertyProductProductRatingRemoved            = c.IsPropertyProductProductRatingRemoved;
            e.IsPropertyProductRatingTypeEnumRemoved           = c.IsPropertyProductRatingTypeEnumRemoved;
            e.IsPropertyProductReturnableRemoved               = c.IsPropertyProductReturnableRemoved;
            e.IsPropertyProductTaxableRemoved                  = c.IsPropertyProductTaxableRemoved;
            e.IsPropertyProductChargeShippingRemoved           = c.IsPropertyProductChargeShippingRemoved;
            e.IsPropertyProductAutoCreateKeywordsRemoved       = c.IsPropertyProductAutoCreateKeywordsRemoved;
            e.IsPropertyProductIncludeInPromotionsRemoved      = c.IsPropertyProductIncludeInPromotionsRemoved;
            e.IsPropertyProductIsVirtualRemoved                = c.IsPropertyProductIsVirtualRemoved;
            e.IsPropertyProductIsVariantRemoved                = c.IsPropertyProductIsVariantRemoved;
            e.IsPropertyProductVirtualVariantMethodEnumRemoved = c.IsPropertyProductVirtualVariantMethodEnumRemoved;
            e.IsPropertyProductInShippingBoxRemoved            = c.IsPropertyProductInShippingBoxRemoved;
            e.IsPropertyProductDefaultShipmentBoxTypeIdRemoved = c.IsPropertyProductDefaultShipmentBoxTypeIdRemoved;
            e.IsPropertyProductIsSerialNumberedRemoved         = c.IsPropertyProductIsSerialNumberedRemoved;
            e.IsPropertyProductIsManagedByLotRemoved           = c.IsPropertyProductIsManagedByLotRemoved;
            e.IsPropertyProductAttributeSetIdRemoved           = c.IsPropertyProductAttributeSetIdRemoved;
            e.IsPropertyProductAttributeSetInstanceIdRemoved   = c.IsPropertyProductAttributeSetInstanceIdRemoved;
            e.IsPropertyProductCreatedByRemoved                = c.IsPropertyProductCreatedByRemoved;
            e.IsPropertyProductCreatedAtRemoved                = c.IsPropertyProductCreatedAtRemoved;
            e.IsPropertyProductUpdatedByRemoved                = c.IsPropertyProductUpdatedByRemoved;
            e.IsPropertyProductUpdatedAtRemoved                = c.IsPropertyProductUpdatedAtRemoved;
            e.IsPropertyProductActiveRemoved = c.IsPropertyProductActiveRemoved;

            e.CommandId = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            var productVersion = c.ProductVersion;


            return(e);
        }