Exemple #1
0
        public Product Map(ProductContract productContract)
        {
            if (productContract == null)
            {
                throw new ArgumentNullException("productContract");
            }

            return(new Product(productContract.Id, productContract.Name, this.Map(productContract.UnitPrice)));
        }
Exemple #2
0
        public void UpdateProduct(ProductContract product)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            var p = this.mapper.Map(product);

            this.repository.UpdateProduct(p);
        }
Exemple #3
0
        public ProductContract Map(Product product)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            var pc = new ProductContract();

            pc.Id        = product.Id;
            pc.Name      = product.Name;
            pc.UnitPrice = this.Map(product.UnitPrice);
            return(pc);
        }