Ejemplo n.º 1
0
        public Product Add(Product product)
        {
            new ProductValidator().ValidateAndThrow(product);

            product.Id = _productAccessor.Add(product);

            return(product);
        }
        public IActionResult AddProduct([FromBody] Product value)
        {
            _products.Add(value);

            return(Created(Request.Path.Value, value));
        }