Пример #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));
        }
Пример #2
0
 public Product PostProduct(Product item)
 {
     return(repository.Add(item));
 }