Ejemplo n.º 1
0
        public Product Convert(ProductMSG productMSG)
        {
            Product product = new Product
            {
                ID             = productMSG.IDMSG,
                titleProduct   = productMSG.TitleProductMSG,
                price          = productMSG.PriceMSG,
                contentProduct = productMSG.ContentProductMSG
            };

            return(product);
        }
Ejemplo n.º 2
0
        public ProductMSG Convert(Product product)
        {
            if (product.titleProduct == null)
            {
                product.titleProduct = string.Empty;
            }

            ProductMSG productMSG = new ProductMSG
            {
                IDMSG             = product.ID,
                TitleProductMSG   = product.titleProduct,
                PriceMSG          = product.price,
                ContentProductMSG = product.contentProduct
            };

            return(productMSG);
        }