Exemplo n.º 1
0
        public IHttpActionResult PostProduct(ProductAPI.core.Entities.Product product)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Add(product);

            return(CreatedAtRoute("DefaultApi", new { id = product.ProductID }, product));
        }
Exemplo n.º 2
0
 public Product PostProduct(Product item)
 {
     return(repository.Add(item));
 }