Exemplo n.º 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));
        }
        public Product Map(ProductContract productContract)
        {
            if (productContract == null)
            {
                throw new ArgumentNullException("productContract");
            }

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

            var p = this.mapper.Map(product);
            this.repository.UpdateProduct(p);
        }
        public void UpdateProduct(ProductContract product)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

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

            this.repository.UpdateProduct(p);
        }
Exemplo n.º 5
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;
        }
        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);
        }